コード例 #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (!movingUp && other.name == "MainPlayer")
        {
            AMS_ScoreController.increaseScore(scoreGainedOnCollection);
            var resourceController = GameObject.Find("Resource_Controller").GetComponent <AMS_ResourceController>();
            if (resourceController != null)
            {
                resourceController.currentResources   += resourceValue;
                resourceController.addedResources.text = "+ " + resourceValue;
                {
                    StartCoroutine("InstantResourceGuiTimer");
                    //  Debug.Log("Coroutine has started");
                }
            }
            else
            {
                Debug.Log("Can't find resource controller");
            }
            var aSwitcher = other.GetComponent <AudioSwitcherScript>();
            if (aSwitcher != null)
            {
                aSwitcher.PlaySound(pickupSound);
            }
            else
            {
                Debug.Log("can't find audio switcher");
            }

            movingUp = true;
        }
    }
コード例 #2
0
ファイル: KeyDoor.cs プロジェクト: Python958/CPT_Capstone
 public void OpenDoor()
 {
     AMS_ScoreController.increaseScore(scoreGainedUponOpening);
     moving = true;
     moved  = true;
     // DoorAudioSource.clip = DoorSounds[0];
     // DoorAudioSource.Play();
 }
コード例 #3
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Door")
        {
            AMS_ScoreController.increaseScore(scoreGainedOnDeposit);

            Destroy(gameObject);
            //increment resource pool in here some where
        }
    }
コード例 #4
0
 public void OpenDoor()
 {
     AMS_ScoreController.increaseScore(scoreGainedUponOpening);
     moving = true;
     moved  = true;
     DoorAudioSource.clip = DoorSounds[0];
     DoorAudioSource.Play();
     SetSpawnPoints(spawnPointsDisable, false);
     SetSpawnPoints(spawnPointsEnable, true);
 }
コード例 #5
0
 private void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.tag == "Player")
     {
         PowerupPFI();
         AMS_ScoreController.increaseScore(scoreGainedOnPickup);
         col.GetComponent <AMS_GunManagement>().powerup       = powerupName;
         col.GetComponent <AMS_GunManagement>().powerupLength = powerupLength;
         col.GetComponent <AMS_GunManagement>().powerupMax    = powerupLength;
         GameObject.FindObjectOfType <AudioSwitcherScript>().PlaySound(powerupSound);
         Destroy(gameObject);
     }
 }
コード例 #6
0
    //Used for trigger the death Sequence
    //KAE - a note on (string type). it doesn't seem to be used so I put "default" as the type on my TakeDamageUnfair() script.
    public void Death(string type)
    {
        ModifyScoreGain(type);
        //Increase Score
        if (scoreGainedOnDeath != 0)
        {
            AMS_ScoreController.increaseScore(scoreGainedOnDeath);
        }
        //Specialized Deaths
        if (gameObject.tag == "Player")
        {
            Debug.Log("Player DieDied");
            ignoreDestroy = true;
            playerDead    = true;
            amDead        = true;
        }
        if (gameObject.tag == "Default_Enemy")
        {
            if (boss == true)
            {
                bossDead = true;
            }
            DefaultEnemyDeath();
        }

        /*  if (gameObject.tag == "StaticDefence")
         * {
         *    ignoreDestroy = false;
         * }
         * if(gameObject.tag == "Turret")
         * {
         *  //  ignoreDestroy = false;
         * }*/
        if (gameObject.tag == "Target")
        {
            TargetDeath();
        }
        if (gameObject.GetComponent <AMS_Hive>() != null)
        {
            gameObject.GetComponent <AMS_Hive>().LastHive();
        }
        //Default Death
        if (!ignoreDestroy)
        {
            if (gameObject.tag != "Hazard")
            {
                Destroy(gameObject);
            }
        }
    }
コード例 #7
0
 private void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.tag == "Player")
     {
         if (gun != null)
         {
             gun.AddAmmo(type);
         }
         AMS_ScoreController.increaseScore(scoreGainedOnPickup);
         if (powerupSound != null)
         {
             GameObject.FindObjectOfType <AudioSwitcherScript>().PlaySound(powerupSound);
         }
         Destroy(gameObject);
     }
 }
コード例 #8
0
    void Update()
    {
        var dist = Vector3.Distance(transform.position, baseHealth.transform.position);

        if (dist <= baseDepositRange)
        {
            AMS_ScoreController.increaseScore(resourceValue);
            //increment resource pool in here some where

            resourceController.currentResources   += resourceValue;
            resourceController.addedResources.text = "+ " + resourceValue; //added GUI update
            {
                StartCoroutine("GuiTimer");
            }
            Destroy(gameObject);
        }
    }
コード例 #9
0
 private void AddScore(int value)
 {
     Debug.Log("this time the house LOSES!");
     AMS_ScoreController.increaseScore(value);
 }