コード例 #1
0
ファイル: Enemy.cs プロジェクト: flamingfox/Gamagora-Unity-TP
    // Use this for initialization
    void OnEnable()
    {
        GetComponent <Rigidbody> ().useGravity  = false;
        GetComponent <Rigidbody> ().isKinematic = false;
        GetComponent <BoxCollider> ().isTrigger = false;
        mesh.SetActive(true);
        deathEffect.init();
        dead = false;

        healthBar.gameObject.SetActive(true);
        healthBar.maxValue = PVMax;
        healthBar.value    = PV;

        Hashtable argsMoveTo = new Hashtable();

        argsMoveTo.Add("path", iTweenPath.GetPath("enemyPath"));
        argsMoveTo.Add("speed", speed);
        argsMoveTo.Add("easetype", "linear");
        argsMoveTo.Add("orienttopath", true);
        argsMoveTo.Add("oncomplete", "OnTarget");

        iTween.MoveTo(gameObject, argsMoveTo);
    }
コード例 #2
0
 virtual protected void OnEnable()
 {
     mesh.SetActive(true);
     dead = false;
     impactEffect.init();
 }