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