void Start() { offset = transform.position - player.transform.position; Water = GameObject.Find("WaterTrigger"); WaterScript = Water.GetComponent <WaterTrigger>(); }
//-------------------------------------------------------- public void Execute() { GameObject go = GameObject.Instantiate(gameObject); go.SetActive(false); go.transform.Translate(Vector3.up * offset); go.name = "basket"; // to prevent multiple suffix "Clone" WaterTrigger wt = go.GetComponentInChildren <WaterTrigger>(); if (wt != null) { wt.DisableObjects(); } go.SetActive(true); }
private void Start() { _canvas = GameObject.Find("Canvas").GetComponent <Canvas>(); _canvasScaler = GameObject.Find("Canvas").GetComponent <CanvasScaler>(); _player = FindObjectOfType <NewPlayer>(); _gammie = FindObjectOfType <Gammie>(); _water = FindObjectOfType <WaterTrigger>(); _endTrigger = FindObjectOfType <EndTrigger>(); _tutorialRage = FindObjectOfType <TutorialRage>(); _bjornActivate = FindObjectOfType <BjornArmActivate>(); _eventManager = EventManager.Instance != null ? EventManager.Instance : FindObjectOfType <EventManager>(); if (_eventManager == null) { Debug.Log("Event Manager is NULL"); } }
public virtual void OnEnterWater(WaterTrigger source) { // By default, do nothing }