Beispiel #1
0
 private void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(_instance);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        UnityEngine.Assertions.Assert.IsNotNull(marchesHandler, "Script egoutScript needs ref to MarchesHandler. obj : " + this.name);
        UnityEngine.Assertions.Assert.IsNotNull(bc, "Script egoutScript needs ref to BlobController. obj : " + this.name);
        UnityEngine.Assertions.Assert.IsNotNull(camera, "Script egoutScript needs ref to CameraMouvement. obj : " + this.name);
        var test = FindObjectsOfType <CheckPointsHandler>();

        if (test.Length > 1 || test.Length < 0)
        {
            Debug.LogError("CheckPointsHandler not found in the scene @" + this.name);
        }
        cph = test[0];
    }
Beispiel #3
0
    // Start is called before the first frame update
    void Start()
    {
        //UnityEngine.Assertions.Assert.IsNotNull(cph, "Script DeathPoint needs ref to CheckPointsHandler. obj : " + this.name);
        var test = FindObjectsOfType <CheckPointsHandler>();

        if (test.Length > 1 || test.Length < 0)
        {
            Debug.LogError("CheckPointsHandler not found in the scene @" + this.name);
        }
        cph = test[0];

        if (crunchDeath)
        {
            rb = gameObject.GetComponent <Rigidbody2D>();
        }
    }
Beispiel #4
0
    // Start is called before the first frame update
    void Start()
    {
        var test = FindObjectsOfType <CheckPointsHandler>();

        if (test.Length > 1 || test.Length < 0)
        {
            Debug.LogError("CheckPointsHandler not found in the scene @" + this.name);
        }
        cph = test[0];

        alarm      = GetComponents <AudioSource>()[0];
        cardiogram = GetComponents <AudioSource>()[1];
        smallBip   = GetComponents <AudioSource>()[2];

        timeToBip        = timerBase;
        safeTime         = safeTimeBase;
        gyrophareHandler = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <GyrophareHandler>();

        hand.gameObject.SetActive(false);
    }
Beispiel #5
0
 private void Start()
 {
     _audioSource    = GetComponent <AudioSource>();
     _gameMaster     = GameObject.FindGameObjectWithTag("gameMaster").GetComponent <CheckPointsHandler>();
     _spriteRenderer = GetComponentInChildren <SpriteRenderer>();
 }
Beispiel #6
0
 private void Start()
 {
     checkPointHandler  = GameObject.FindGameObjectWithTag("gameMaster").GetComponent <CheckPointsHandler>();
     transform.position = checkPointHandler.lastCheckPointPos;
 }
Beispiel #7
0
 // Start is called before the first frame update
 void Start()
 {
     Handler = GetComponentInParent <CheckPointsHandler>();
 }
Beispiel #8
0
 private void Awake()
 {
     rb = this.GetComponent <Rigidbody>();
     inputController   = this.GetComponent <CharacterInput>();
     checkpointHandler = this.GetComponent <CheckPointsHandler>();
 }