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; }
public void TakeDamage() { WaterBar water = GameObject.FindWithTag("Player").GetComponent <WaterBar>(); water.LoseWater(damage); }
public void Click() { WaterBar water = GameObject.FindWithTag("Player").GetComponent <WaterBar>(); water.AddWater(addAmount * Time.deltaTime); }
private void Awake() { player = GameObject.FindWithTag("Player").GetComponent <WaterBar>(); foreground = GetComponent <Image>(); }
private void Awake() { plant = GameObject.FindWithTag("Player").GetComponent <WaterBar>(); boy = GameObject.FindWithTag("Boy").GetComponent <Boy>(); }