Ejemplo n.º 1
0
 //mainly done so I can make it zero cost
 public void UnlockAbility(int ability, int cost)
 {
     //Check to see if they can buy it
     if (resourceControls == null)
     {
         Debug.Log("where did resource Controls go"); resourceControls = FindObjectOfType <AMS_ResourceController>();
     }
     if (resourceControls.currentResources >= cost)
     {
         //Turn off the greyed out box
         greyBoxes[ability].SetActive(false);
         //Turn on the upgrade button
         Debug.Log(upgradeButtons[ability]);
         upgradeButtons[ability].SetActive(true);
         //Turn on the use button
         useButtons[ability].SetActive(true);
         //Turn off the unlock button
         unlockButtons[ability].SetActive(false);
         //Takes the cost
         resourceControls.currentResources -= cost;
         //Sets the unlocked variable to true
         unlockedAbilities[ability] = true;
         cooldownControl.purchasableAbilities[ability] = true;
     }
     else
     {
         notEnoughMessage.SetActive(true);
     }
 }//overload for main UnlockAbility function
Ejemplo n.º 2
0
    private void Start()
    {
        resourceController = FindObjectOfType <AMS_ResourceController>();
        if (resourceController == null)
        {
            Debug.Log("can't find resource controller object");
        }

        //this is just to find the bottom of the object
        var capColl = gameObject.GetComponent <CapsuleCollider>();

        if (capColl != null)
        {
            rayOffset = (capColl.height / 2f) * gameObject.transform.localScale.y;
        }
        else
        {
            rayOffset = 1f;
        }

        note = gameObject.GetComponentInChildren <Canvas>().gameObject;
        if (note == null)
        {
            Debug.Log("can't find canvas gameObject");
        }

        baseHealth = FindObjectOfType <BaseHealth>();
        if (baseHealth == null)
        {
            Debug.Log("basehealth not found in scene");
        }
    }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     resourceControls = GameObject.FindObjectOfType <AMS_ResourceController>();
     if (resourceControls == null)
     {
         Debug.Log("can't find AMS_ResourceController");
     }
     buyMenuPlayer = GameObject.FindObjectOfType <AMS_BuyMenuPlayer>();
     playerGun     = GameObject.FindObjectOfType <AMS_GunManagement>();
     BuyMenuDescriptionText.enabled = false; //disable buy menu description
     AbilitiesToDisableOnStart();
 }
Ejemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        DoorRenderer = objectToMove.GetComponent <Renderer>();
        resourceCont = GameObject.FindObjectOfType <AMS_ResourceController>();
        if (resourceCont == null)
        {
            Debug.Log("ERROR: can't find resource controller");
            Debug.Log("Self Destructing!!!");
            Destroy(gameObject);
        }

        /*else
         * {
         *  actualTarget = resourceCont.winConditionResources * percOfCap;
         *  if (percOfCap != 1f)
         *  {
         *      var component = GetComponentInChildren<LevelGateHelperScript>();
         *      if (component != null) { Destroy(component.gameObject); Debug.Log("Deleting mid gate trigger volume - see comments"); }//This is deleted because if you don't need the full resource amount to open it is probably not a level end
         *      else { Debug.Log("can't find trigger, maybe someone already deleted it"); }
         *  }
         * }
         */
        var moveHSpeed = moveAmountHorizontal / timeOfMove;
        var moveVSpeed = moveAmountVertical / timeOfMove;

        moveSpeed                   = new Vector3(moveHSpeed, moveVSpeed, 0f);
        DoorAudioSource             = gameObject.GetComponent <AudioSource>();
        DoorAudioSource.playOnAwake = false; //Turn off playOnAwake
        DoorAudioSource.playOnAwake = false;
        // DoorAudioSource.outputAudioMixerGroup.audioMixer.name = "SfxMixer";
        ResourceScript = GameObject.FindObjectOfType <ResourceScript>();

        SetSpawnPoints(spawnPointsEnable, false);//this sets whatever the door would enable to disabled

        /*  for (int i = 0; i < DoorSounds.Length; i++)
         * {
         *    DoorSoundPicked++;
         * }*/
    }
Ejemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     resourceController = FindObjectOfType <AMS_ResourceController>();
 }
Ejemplo n.º 6
0
 public PlayerData(AMS_ResourceController resource)
 {
     resources = resource.GetComponent <AMS_ResourceController>().currentResources;
 }
Ejemplo n.º 7
0
 //Sets current placed turrets to 0
 void Start()
 {
     Turret1.SetActive(false);
     currentPlaced    = 0;
     resourceControls = GameObject.FindObjectOfType <AMS_ResourceController>();
 }