예제 #1
0
    // 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();
 }