//GameObject _pickaxe;

    //Mine_Object mineScript;

    /*
     * private void Start()
     * {
     *  _pickaxe = GameObject.FindGameObjectWithTag("Pickaxe");
     *  mineScript = _pickaxe.GetComponent<Mine_Object>();
     * }
     */
    /*
     * private void OnMouseEnter()
     * {
     *  mineScript.SetValidTarget(true, gameObject);
     * }
     *
     * private void OnMouseExit()
     * {
     *  mineScript.ClearTarget();
     * }
     */

    private void Update()
    {
        if (hitPoints <= 0)
        {
            Mine_Object mine_Object = FindObjectOfType <Mine_Object>();
            mine_Object.SetSwingState(false);

            Destroy(gameObject);
        }
    }
Ejemplo n.º 2
0
 private void OnMouseOver()
 {
     if (useEffect)
     {
         if (mine_Object != null)
         {
             if (WithinRange())
             {
                 mine_Object.SetSwingState(true);
                 outlineEffect.enabled = true;
             }
             else
             {
                 mine_Object.SetSwingState(false);
                 outlineEffect.enabled = false;
             }
         }
         else
         {
             mine_Object = FindObjectOfType <Mine_Object>();
         }
     }
 }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     miner  = FindObjectOfType <Mine_Object>();
     player = FindObjectOfType <Player_Controller_v1>().gameObject;
 }
Ejemplo n.º 4
0
 private void AssignMiner()
 {
     mine_Object   = FindObjectOfType <Mine_Object>();
     minerAssigned = true;
 }