Exemple #1
0
 // Start is called before the first frame update
 void Start()
 {
     if (imageEffect == null)
     {
         imageEffect = GetComponent <ScreenTransitionImageEffect>() as ScreenTransitionImageEffect;
     }
 }
Exemple #2
0
    // 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);
        }
    }
Exemple #3
0
    //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;
        }
    }
Exemple #4
0
 private void Awake()
 {
     singleton = this;
 }
Exemple #5
0
 void Awake()
 {
     effect      = GetComponent <ScreenTransitionImageEffect> ();
     startFading = playOnStart;
 }
 void Start()
 {
     player     = GameObject.FindGameObjectWithTag("Player");
     transition = GetComponent <ScreenTransitionImageEffect>();
 }