public Arrow() { m_status = ArrowStatus.WAIT; m_AttackArea = new List <MapPos>(); m_TriggerArea = new List <MapPos>(); m_Trigger = new List <PlayerType>(); }
// Start is called before the first frame update void Start() { GameRule.get.RegisterPlayerProjectile(this); Rigidbody2D rigidbodycomp = GetComponent <Rigidbody2D>(); rigidbodycomp.angularVelocity = AngularVelocity; Status = ArrowStatus.Flying; }
void Update() { if (bReturning && Status == ArrowStatus.Flying) { Rigidbody2D rigidbodycomp = GetComponent <Rigidbody2D>(); rigidbodycomp.velocity = (PostHitLandingLocation - gameObject.transform.position).normalized * LaunchSpeed; if ((PostHitLandingLocation - gameObject.transform.position).sqrMagnitude < 0.5) { gameObject.GetComponent <AudioSource>().Stop(); Status = ArrowStatus.Landed; GameRule.get.RepathBoss(); rigidbodycomp.velocity = Vector3.zero; rigidbodycomp.angularVelocity = 0; } } }
private void OnTriggerEnter2D(Collider2D collision) { arrowState = ArrowStatus.Hits; rigidbody2D.simulated = false; Player player = GameObject.Find("player").GetComponent <Player>(); }
// Use this for initialization void Start() { prev = transform.position; //前回の座標初期化 arrowState = ArrowStatus.Flyng; rigidbody2D = this.GetComponent <Rigidbody2D>(); }
public void SetType(ArrowStatus iType) { m_status = iType; }