|
|
|
@ -24,7 +24,6 @@ public class Main : MonoBehaviour
|
|
|
|
|
public Dictionary<string, List<string>> attachmentAssetsNames = new Dictionary<string, List<string>>();
|
|
|
|
|
public Dictionary<string, string> charaWeapon = new Dictionary<string, string>();
|
|
|
|
|
public Dictionary<string, string> attachmentPosition = new Dictionary<string, string>();
|
|
|
|
|
public float speed;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
void Start()
|
|
|
|
@ -35,7 +34,6 @@ public class Main : MonoBehaviour
|
|
|
|
|
loadCharaCSV();
|
|
|
|
|
loadWeaponCSV();
|
|
|
|
|
loadAttachmentCSV();
|
|
|
|
|
speed = 1.0f;
|
|
|
|
|
|
|
|
|
|
GameObject.Find("charaDropdown").GetComponent<Dropdown>().value = 14;
|
|
|
|
|
}
|
|
|
|
@ -248,6 +246,7 @@ public class Main : MonoBehaviour
|
|
|
|
|
#region Animator
|
|
|
|
|
public void loadAnimator(int i)
|
|
|
|
|
{
|
|
|
|
|
if (weapon != null) Destroy(weapon);
|
|
|
|
|
if (i == 0)
|
|
|
|
|
{
|
|
|
|
|
chara.GetComponent<Animator>().runtimeAnimatorController = originAnimator;
|
|
|
|
@ -345,11 +344,11 @@ public class Main : MonoBehaviour
|
|
|
|
|
#region Action
|
|
|
|
|
public void setState(int i)
|
|
|
|
|
{
|
|
|
|
|
if (i != 1) removeWeapon();
|
|
|
|
|
if (i == 2 || i == 3) chara.transform.rotation = Quaternion.Euler(0, 180, 0);
|
|
|
|
|
else chara.transform.rotation = Quaternion.Euler(0, 0, 0);
|
|
|
|
|
if (chara.GetComponent<Animator>() != null)
|
|
|
|
|
chara.GetComponent<Animator>().SetInteger(Animator.StringToHash("State"), i);
|
|
|
|
|
setTrigger("EventStep");
|
|
|
|
|
if (i == 6) removeWeapon();
|
|
|
|
|
if (i == 2 || i == 3) rotate180();
|
|
|
|
|
else rotate0();
|
|
|
|
|
SetInteger("State", i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setRoom(int i)
|
|
|
|
@ -404,9 +403,24 @@ public class Main : MonoBehaviour
|
|
|
|
|
setTrigger(names[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setBattleStartBoss()
|
|
|
|
|
{
|
|
|
|
|
rotate180();
|
|
|
|
|
setTrigger("BattleStartBoss");
|
|
|
|
|
setTrigger("EventStep");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setBattleStartPlayer()
|
|
|
|
|
{
|
|
|
|
|
rotate180();
|
|
|
|
|
setTrigger("BattleStartPlayer");
|
|
|
|
|
setTrigger("EventStep");
|
|
|
|
|
Invoke("EventStep", 0.2f);
|
|
|
|
|
//Invoke("EventStep", 5f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setSpeed(float value)
|
|
|
|
|
{
|
|
|
|
|
speed = value;
|
|
|
|
|
if (chara.GetComponent<Animator>() != null)
|
|
|
|
|
chara.GetComponent<Animator>().speed = value;
|
|
|
|
|
if (weapon && weapon.GetComponent<Animator>() != null)
|
|
|
|
@ -434,6 +448,18 @@ public class Main : MonoBehaviour
|
|
|
|
|
weaponR.GetComponent<Animator>().SetTrigger(Animator.StringToHash(triggerName));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetInteger(string triggerName, int value)
|
|
|
|
|
{
|
|
|
|
|
if (chara.GetComponent<Animator>() != null)
|
|
|
|
|
chara.GetComponent<Animator>().SetInteger(Animator.StringToHash(triggerName), value);
|
|
|
|
|
if (weapon && weapon.GetComponent<Animator>() != null)
|
|
|
|
|
weapon.GetComponent<Animator>().SetInteger(Animator.StringToHash(triggerName), value);
|
|
|
|
|
if (weaponL && weaponL.GetComponent<Animator>() != null)
|
|
|
|
|
weaponL.GetComponent<Animator>().SetInteger(Animator.StringToHash(triggerName), value);
|
|
|
|
|
if (weaponR && weaponR.GetComponent<Animator>() != null)
|
|
|
|
|
weaponR.GetComponent<Animator>().SetInteger(Animator.StringToHash(triggerName), value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void setFloat(string triggerName, float value)
|
|
|
|
|
{
|
|
|
|
|
if (chara.GetComponent<Animator>() != null)
|
|
|
|
@ -457,6 +483,25 @@ public class Main : MonoBehaviour
|
|
|
|
|
if (weaponR && weaponR.GetComponent<Animator>() != null)
|
|
|
|
|
weaponR.GetComponent<Animator>().SetBool(Animator.StringToHash(triggerName), value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void EventStep()
|
|
|
|
|
{
|
|
|
|
|
setTrigger("EventStep");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void rotate180()
|
|
|
|
|
{
|
|
|
|
|
chara.transform.rotation = Quaternion.Euler(0, 180, 0);
|
|
|
|
|
if (weapon != null) weapon.transform.rotation = Quaternion.Euler(0, 180, 0);
|
|
|
|
|
if (attachment != null) attachment.transform.rotation = Quaternion.Euler(0, 180, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void rotate0()
|
|
|
|
|
{
|
|
|
|
|
chara.transform.rotation = Quaternion.Euler(0, 0, 0);
|
|
|
|
|
if (weapon != null) weapon.transform.rotation = Quaternion.Euler(0, 0, 0);
|
|
|
|
|
if (attachment != null) attachment.transform.rotation = Quaternion.Euler(0, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -480,6 +525,8 @@ public class Main : MonoBehaviour
|
|
|
|
|
else if (Input.GetKeyDown(KeyCode.F)) setAttack(3);
|
|
|
|
|
else if (Input.GetKeyDown(KeyCode.G)) setAttack(4);
|
|
|
|
|
else if (Input.GetKeyDown(KeyCode.X)) setDamage();
|
|
|
|
|
else if (Input.GetKeyDown(KeyCode.J)) setBattleStartPlayer();
|
|
|
|
|
else if (Input.GetKeyDown(KeyCode.K)) setBattleStartBoss();
|
|
|
|
|
else if (Input.GetKeyDown(KeyCode.Space))
|
|
|
|
|
GameObject.Find("stopbutton").GetComponent<Button>().onClick.Invoke();
|
|
|
|
|
else if (Input.GetKeyDown(KeyCode.Z))
|
|
|
|
@ -488,7 +535,7 @@ public class Main : MonoBehaviour
|
|
|
|
|
t.isOn = !t.isOn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (Input.GetMouseButtonDown(0)) { }
|
|
|
|
|
// if (Input.GetMouseButtonDown(0)) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LateUpdate()
|
|
|
|
@ -502,6 +549,5 @@ public class Main : MonoBehaviour
|
|
|
|
|
block.SetVector("_DecalTex_ST", new Vector4(1f, 1f, u, v));
|
|
|
|
|
charaFaceRender.SetPropertyBlock(block);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|