// Start is called before the first frame update void Start() { if (imageEffect == null) { imageEffect = GetComponent <ScreenTransitionImageEffect>() as ScreenTransitionImageEffect; } }
// Update is called once per frame void Update() { if (!health.IsDead()) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { transform.LookAt(new Vector3(hit.point.x, transform.position.y, hit.point.z)); } MovePlayer(); } else { foreach (GameObject go in deathParticles) { Instantiate(go, transform.position, transform.rotation); } ScreenTransitionImageEffect transition = Camera.main.GetComponent <ScreenTransitionImageEffect>(); transition.ChangeScene = true; transition.sceneName = "DeathScene"; GameObject[] objects = GameObject.FindGameObjectsWithTag("Enemy"); foreach (GameObject go in objects) { go.SetActive(false); } gameObject.SetActive(false); } }
//private int counter = 0; // Start is called before the first frame update void Start() { if (!startsAlreadyFadedIn && !fadedIn) { transitionAnim.Play("FadeIn"); fadedIn = true; } transitionMask = transitionMaskGameObject.GetComponent <ScreenTransitionImageEffect>(); if (transitionMask.maskValue <= 0.000f) { goingUp = true; goingDown = false; } else if (transitionMask.maskValue >= 1.000f) { goingDown = true; goingUp = false; } }
private void Awake() { singleton = this; }
void Awake() { effect = GetComponent <ScreenTransitionImageEffect> (); startFading = playOnStart; }
void Start() { player = GameObject.FindGameObjectWithTag("Player"); transition = GetComponent <ScreenTransitionImageEffect>(); }