|
|
@ -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,10 @@ public class Main : MonoBehaviour
|
|
|
|
#region Action
|
|
|
|
#region Action
|
|
|
|
public void setState(int i)
|
|
|
|
public void setState(int i)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (i != 1) removeWeapon();
|
|
|
|
if (i == 6) removeWeapon();
|
|
|
|
if (i == 2 || i == 3) chara.transform.rotation = Quaternion.Euler(0, 180, 0);
|
|
|
|
if (i == 2 || i == 3) rotate180();
|
|
|
|
else chara.transform.rotation = Quaternion.Euler(0, 0, 0);
|
|
|
|
else rotate0();
|
|
|
|
if (chara.GetComponent<Animator>() != null)
|
|
|
|
SetInteger("State", i);
|
|
|
|
chara.GetComponent<Animator>().SetInteger(Animator.StringToHash("State"), i);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setRoom(int i)
|
|
|
|
public void setRoom(int i)
|
|
|
@ -404,9 +402,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 +447,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 +482,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 +524,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))
|
|
|
@ -488,7 +534,7 @@ public class Main : MonoBehaviour
|
|
|
|
t.isOn = !t.isOn;
|
|
|
|
t.isOn = !t.isOn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// if (Input.GetMouseButtonDown(0)) { }
|
|
|
|
// if (Input.GetMouseButtonDown(0)) {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LateUpdate()
|
|
|
|
void LateUpdate()
|
|
|
@ -502,6 +548,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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|