Ejemplo n.º 1
0
 void Start()
 {
     checkLives = GameObject.Find("Lives").GetComponent <CheckpointLives>();         //Find and assign the Script associated with the game object
     char2D     = GameObject.Find("Player").GetComponent <CharController2D>();       //Find and assign the Script associated with the game object
     invisWall  = GameObject.Find("BossWall").GetComponent <InvisWall>();            //Find and assign the Script associated with the game object
     bossScene1 = GameObject.Find("BossTrigger").GetComponent <BossScene1>();        //Find and assign the Script associated with the game object
     hitCount   = checkLives.lives;
 }
Ejemplo n.º 2
0
    void Awake()
    {
        //_animator = GetComponent<Animator>();
        _controller = GetComponent <CharController2D>();

        // listen to some events for illustration purposes
        _controller.onTriggerEnterEvent += onTriggerEnterEvent;
    }
Ejemplo n.º 3
0
 public void setMessageMode(bool mode)
 {
     char2D = gameObject.GetComponent <CharController2D>();                                                  //<CLASS NAME>
     //Check if the player is in the air
     if (char2D.gravity > 0.0f)
     {
         print("true");
     }
 }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        player          = GameObject.FindWithTag("Player");
        _controller     = player.GetComponent <CharController2D> ();
        _playerMovement = player.GetComponent <PlayerMovement> ();

        minX = GetComponent <Collider2D> ().bounds.min.x;
        maxX = GetComponent <Collider2D> ().bounds.max.x;
        minY = GetComponent <Collider2D> ().bounds.min.y;
        maxY = GetComponent <Collider2D> ().bounds.max.y;
    }
Ejemplo n.º 5
0
 // Update is called once per frame
 void Update()
 {
     timeleft      -= Time.deltaTime;
     timerText.text = Mathf.RoundToInt(timeleft).ToString();
     if (timeleft < 0)
     {
         if (CharController2D.isAlive)
         {
             CharController2D.Die();
         }
     }
 }
Ejemplo n.º 6
0
    // Set default camera on Startup
    void Start()
    {
        movement2D  = GameObject.Find("Player").GetComponent <CharController2D>();  //"OBJECT NAME" <CLASS NMAE>
        movement3D1 = GameObject.Find("Player").GetComponent <CharController3D1>(); //"OBJECT NAME" <CLASS NMAE>
        movement3D2 = GameObject.Find("Player").GetComponent <CharController3D2>(); //"OBJECT NAME" <CLASS NMAE>
        timerView3d = GameObject.Find("TimerView3d");                               //"OBJECT NAME" <CLASS NMAE>
        intTime     = (int)playerTime;
        timerView3d.guiText.text = "3DTimer : " + intTime.ToString();

        cam2D.camera.enabled  = true;
        cam3D1.camera.enabled = false;
        cam3D2.camera.enabled = false;
    }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     char2D  = GameObject.Find("Player").GetComponent <CharController2D>();                  //"OBJECT NAME" <CLASS NAME>
     char3D1 = GameObject.Find("Player").GetComponent <CharController3D1>();                 //"OBJECT NAME" <CLASS NAME>
 }
Ejemplo n.º 8
0
 void Start()
 {
     CharController = GameObject.Find("Player").GetComponent <CharController2D>();       //"OBJECT NAME" <CLASS NMAE>
 }
Ejemplo n.º 9
0
 private void Start()
 {
     charController = FindObjectOfType <CharController2D>();
 }
Ejemplo n.º 10
0
    public bool inAir = false;                                                  //Detects if AI is not Grounded

    // Use this for initialization
    void Start()
    {
        charControl  = GameObject.Find("Player").GetComponent <CharController2D>();                     //Find and assign the Script associated with the game object
        cameraListen = GameObject.Find("CameraListener").GetComponent <CameraListener>();               //Find and assign the Script associated with the game object
    }
Ejemplo n.º 11
0
 void Start()
 {
     isAlive  = true;
     Instance = this;
     SoundManager.Instance.PlayOneShot(SoundManager.Instance.respawn);
 }
Ejemplo n.º 12
0
 public void Awake()
 {
     Health = MaxHealth;
     _controller = GetComponent<CharController2D>();
     _isFacingRight = transform.localScale.x > 0;
 }
Ejemplo n.º 13
0
 void Start()
 {
     controller = GetComponent <CharController2D>();
 }