Exemple #1
0
 // Gets animator, camera and controls
 void Start()
 {
     joystic = GameObject.Find("JoysticBG").GetComponent <VirtualJoystic>();
     if (joystic == null)
     {
         Debug.LogError("404: joystic in PlayerCtrl");
     }
     arrow = GameObject.Find("Arrows").GetComponent <Arrow>();
     if (arrow == null)
     {
         Debug.LogError("404: arrow in PlayerCtrl");
     }
     b_atk = GameObject.Find("Atk").GetComponent <But_pressed>();
     if (b_atk == null)
     {
         Debug.LogError("404: b_atk in PlayerCtrl");
     }
     anim = GameObject.Find("Pollo").GetComponent <Animator>();
     if (anim == null)
     {
         Debug.LogError("404: anim in PlayerCtrl");
     }
     cm = GameObject.Find("Main Camera").GetComponent <CamMov>();
     if (cm == null)
     {
         Debug.LogError("404: cm in PlayerCtrl");
     }
 }
Exemple #2
0
 void Start()
 {
     permiso    = false;
     cameraComp = gameCamera.GetComponent <Camera>();
     scrCamara  = gameCamera.GetComponent <CamMov>();
     oldSize    = cameraComp.fieldOfView;
     oldOffsetX = scrCamara.OffsetX;
     oldOffsetY = scrCamara.OffsetY;
 }
Exemple #3
0
    // Shows first screens and get components on level
    void Start()
    {
        gameover = GameObject.Find("GameOver");
        win      = GameObject.Find("WIN");
        txtEnem  = GameObject.Find("TextM").GetComponent <Text>();
        txtGear  = GameObject.Find("TextG").GetComponent <Text>();
        txtScore = GameObject.Find("TextScore").GetComponent <Text>();

        win.SetActive(false);
        gameover.SetActive(false);

        pStats = GameObject.Find("Player").GetComponent <PlayerStats>();
        if (pStats == null)
        {
            Debug.LogError("404: pStats in game");
        }
        camMov = GameObject.Find("Main Camera").GetComponent <CamMov>();
        if (camMov == null)
        {
            Debug.LogError("404: camMov in Game");
        }
        camMov.enabled = false;
        controls       = GameObject.Find("Controls");
        if (controls == null)
        {
            Debug.LogError("404: controls in Game");
        }
        controls.SetActive(false);
        pCtrl = GameObject.Find("Player").GetComponent <PlayerControl>();
        if (pCtrl == null)
        {
            Debug.LogError("404: pCtrl in Game");
        }
        pCtrl.enabled = false;

        score = GameObject.Find("score");
        score.SetActive(false);
        end = GameObject.Find("End");
        end.SetActive(false);
        tap    = GameObject.Find("Tap");
        tapBut = tap.transform.GetComponentInChildren <Tap>();
    }
Exemple #4
0
 // Get components and order creates the first section of scene
 void Start()
 {
     pStats = GameObject.Find("Player").GetComponent <PlayerStats>();
     if (pStats == null)
     {
         Debug.LogError("404: pStats in generate");
     }
     game = GameObject.Find("Game").GetComponent <Game>();
     cm   = GameObject.Find("Main Camera").GetComponent <CamMov>();
     key  = Settings.key;
     cam  = GameObject.Find("Main Camera");
     if (cam == null)
     {
         Debug.Log("404: cam in Generate");
     }
     adding = -mesure;
     Add();
     Add();
     Add();
     Add();
     camPos = mesure;
 }