Esempio n. 1
0
    void Start()
    {
        bc                  = GetComponent <BoxCollider>();
        rb                  = GetComponent <Rigidbody>();
        pref_footprint      = (GameObject)Resources.Load("prefabs/Footprint", typeof(GameObject));
        pref_footprint_sock = (GameObject)Resources.Load("prefabs/Footprint_sock", typeof(GameObject));
        pref_footprint_shoe = (GameObject)Resources.Load("prefabs/Footprint_shoe", typeof(GameObject));
        dp                  = Resources.Load <GameObject>("prefabs/DustParticle");
        bar_pants           = GameObject.Find("TrouserStatus");

        var ws = GameObject.Find("WaterStatus");

        if (ws != null)
        {
            waterBar = ws.GetComponent <WaterBar>();
        }

        if (this.name == "Leg_left")
        {
            other_leg = GameObject.Find("Leg_right");
        }
        else
        {
            other_leg = GameObject.Find("Leg_left");
        }
        Debug.Log(other_leg.name);

        cam = Camera.main;

        //hide and lock mouse
        Cursor.lockState = CursorLockMode.Locked;
    }
Esempio n. 2
0
    public void TakeDamage()
    {
        WaterBar water = GameObject.FindWithTag("Player").GetComponent <WaterBar>();

        water.LoseWater(damage);
    }
Esempio n. 3
0
    public void Click()
    {
        WaterBar water = GameObject.FindWithTag("Player").GetComponent <WaterBar>();

        water.AddWater(addAmount * Time.deltaTime);
    }
Esempio n. 4
0
 private void Awake()
 {
     player     = GameObject.FindWithTag("Player").GetComponent <WaterBar>();
     foreground = GetComponent <Image>();
 }
Esempio n. 5
0
 private void Awake()
 {
     plant = GameObject.FindWithTag("Player").GetComponent <WaterBar>();
     boy   = GameObject.FindWithTag("Boy").GetComponent <Boy>();
 }