コード例 #1
0
    public override void doSkill()
    {
        if (gasing.getSP() > skillPointNeeded)
        {
            targetEnemy = findNearestEnemy();                           //cari terus musuh terdekat
            if (targetEnemy)
            {
                gasingEnemy = targetEnemy.GetComponent <Gasing> ();

                if (GamePrefs.isMultiplayer)
                {
                    Network.Instantiate(prefab, targetEnemy.transform.position, Quaternion.Euler(270, 0, 0), 11);
                    Network.Instantiate(prefab, targetEnemy.transform.position, Quaternion.Euler(270, 0, 0), 11);
                    Network.Instantiate(prefab, targetEnemy.transform.position, Quaternion.Euler(270, 0, 0), 11);
                }
                else
                {
                    Instantiate(prefab, targetEnemy.transform.position, Quaternion.Euler(270, 0, 0));
                    Instantiate(prefab, targetEnemy.transform.position, Quaternion.Euler(270, 0, 0));
                    Instantiate(prefab, targetEnemy.transform.position, Quaternion.Euler(270, 0, 0));
                }

                gasingEnemy.EPKurang(damageInflicted);
                gasing.SPKurang(skillPointNeeded);                              //kurangi skillpoint gasing

                base.doSkill();
            }
        }
    }
コード例 #2
0
 public override void doSkill()
 {
     if (gasing.getSP() > skillPointNeeded)
     {
         if (GamePrefs.isMultiplayer)
         {
             GameObject bom = (GameObject)Network.Instantiate(prefabBomb, new Vector3(transform.position.x, transform.position.y + 2, transform.position.z), Quaternion.Euler(0, 0, 0), 11);
             bom.GetComponent <BombScript>().nyalakan(this.gameObject, findNearestEnemy());
         }
         else
         {
             GameObject bom = (GameObject)Instantiate(prefabBomb, new Vector3(transform.position.x, transform.position.y + 2, transform.position.z), Quaternion.Euler(0, 0, 0));
             bom.GetComponent <BombScript>().nyalakan(this.gameObject, findNearestEnemy());
         }
         gasing.SPKurang(skillPointNeeded);
         base.doSkill();
     }
 }
コード例 #3
0
 public override void doSkill()
 {
     if (gasing.getSP() > skillPointNeeded)
     {
         if (gasing.isOnGround)
         {
             float   jump_coef = 15000f;
             Vector3 movement  = new Vector3(0f, 15f, 0f);
             if (audioJump)
             {
                 audio.PlayOneShot(audioJump);
             }
             rigidbody.AddForce(movement * jump_coef * Time.deltaTime);
             gasing.isOnGround = false;
             gasing.SPKurang(skillPointNeeded);
             base.doSkill();
         }
     }
 }
コード例 #4
0
 public override void doSkill()
 {
     if (gasing.getSP() > skillPointNeeded)
     {
         targetEnemy = findNearestEnemy();                           //cari musuh terdekat
         if (targetEnemy)
         {
             gasingEnemy = targetEnemy.GetComponent <Gasing> ();
             if (GamePrefs.isMultiplayer)
             {
                 Network.Instantiate(prefab, new Vector3(targetEnemy.transform.position.x, targetEnemy.transform.position.y + 15, targetEnemy.transform.position.z), Quaternion.Euler(0, 0, 0), 12);
             }
             else
             {
                 Instantiate(prefab, new Vector3(targetEnemy.transform.position.x, targetEnemy.transform.position.y + 15, targetEnemy.transform.position.z), Quaternion.Euler(0, 0, 0));
             }
             gasing.SPKurang(skillPointNeeded);
             base.doSkill();
         }
     }
 }
コード例 #5
0
 public override void doSkill()
 {
     targetEnemy = findNearestEnemy();                       //cari terus musuh terdekat
     if (gasing.getSP() > skillPointNeeded)
     {
         if (targetEnemy)
         {
             if (GamePrefs.isMultiplayer)
             {
                 GameObject misil = (GameObject)Network.Instantiate(prefabMissile, new Vector3(transform.position.x, transform.position.y + 2, transform.position.z), Quaternion.LookRotation(targetEnemy.transform.position - transform.position - new Vector3(0, -90, 0)), 11);
                 misil.GetComponent <MissileScript>().nyalakan(targetEnemy);
             }
             else
             {
                 GameObject misil = (GameObject)Instantiate(prefabMissile, new Vector3(transform.position.x, transform.position.y + 2, transform.position.z), Quaternion.LookRotation(targetEnemy.transform.position - transform.position - new Vector3(0, -90, 0)));
                 misil.GetComponent <MissileScript>().nyalakan(targetEnemy);
             }
             gasing.SPKurang(skillPointNeeded);
             base.doSkill();
         }
     }
 }
コード例 #6
0
 public override void doSkill()
 {
     if (gasing.getSP() > skillPointNeeded)
     {
         float x;
         float z;
         if (Application.platform == RuntimePlatform.Android)
         {
             x = transform.position.x + 50 * Input.acceleration.x;
             z = transform.position.z + 50 * Input.acceleration.y;
         }
         else
         {
             x = transform.position.x + 15 * Input.GetAxis("Horizontal");
             z = transform.position.z + 15 * Input.GetAxis("Vertical");
         }
         if (x < 20 && z < 20 && x > -20 && z > -20)                         //hardcode buat stonefield aja
         {
             transform.position = new Vector3(x, 1f, z);
         }
         gasing.SPKurang(skillPointNeeded);
         base.doSkill();
     }
 }