Exemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        screenDimensions = new Vector2(Screen.width, Screen.height);

        /*
         * positionsOfNames[0] = 1040;
         * positionsOfNames[1] = 1000;
         * positionsOfNames[2] = 960;
         * positionsOfNames[3] = 920;
         * positionsOfNames[4] = 880;
         * positionsOfNames[5] = 840;
         */

        positionsOfNames[0] = screenDimensions.y - 50;
        positionsOfNames[1] = screenDimensions.y - 90;
        positionsOfNames[2] = screenDimensions.y - 130;
        positionsOfNames[3] = screenDimensions.y - 170;
        positionsOfNames[4] = screenDimensions.y - 210;
        positionsOfNames[5] = screenDimensions.y - 250;
        positionsOfNames[6] = screenDimensions.y - 290;
        positionsOfNames[7] = screenDimensions.y - 330;
        gotItems            = false;
        deadGoatIndex       = 0;

        instance = GetComponentInParent <PlayerInstanceGenerator>();
    }
Exemplo n.º 2
0
 private void Start()
 {
     WinMenuUI.SetActive(false);
     instance  = GameObject.FindGameObjectWithTag("PlayerManager").GetComponent <PlayerInstanceGenerator>();
     canModify = true;
     danceDone = false;
 }
Exemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     instance  = GameObject.FindGameObjectWithTag("PlayerManager").GetComponent <PlayerInstanceGenerator>();
     allowRise = false;
     startPos  = transform.position;
     endPos    = new Vector3(transform.position.x, endPosValue, transform.position.z);
     speed     = 1.25f;
 }
Exemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     goal.enabled         = true;
     platformRule.enabled = false;
     waterRule.enabled    = false;
     snowballRule.enabled = false;
     StartCoroutine("timerTillDisactive");
     instance = GameObject.FindGameObjectWithTag("PlayerManager").GetComponent <PlayerInstanceGenerator>();
     //WaterUI = instance.gameObject.GetComponent<RankingSystem>();
     waterCountdown = false;
 }
    private void Awake()
    {
        if (instanceOBJ == null)    // Only keep this instance of this object alive. Dont destroy it after changing scenes and destroy any duplicates
        {
            instanceOBJ = this;
        }
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);

        Instance    = GetComponent <PlayerInputManager>();
        changed     = false;
        gotRankings = false;
    }
Exemplo n.º 6
0
    // Start is called before the first frame update
    void Start()
    {
        DontDestroyOnLoad(gameObject.transform.root.gameObject);

        anim = GetComponent <Animator>();

        MountainPoints[0] = new Vector3(0, -2.35f, 0);
        MountainPoints[1] = new Vector3(0, -76.8f, -48f);
        MountainPoints[2] = new Vector3(0, 214, 115.8f);
        MountainPoints[3] = new Vector3(0, -351.2f, 158.7f);
        instance          = GameObject.FindGameObjectWithTag("PlayerManager").GetComponent <PlayerInstanceGenerator>();
        onGround          = false;
        jumpPressure      = 0f;
        minJumpValue      = 5f;
        maxJumpPressure   = 5f;
        maxfallSpeed      = -1f;
        rb                  = GetComponent <Rigidbody>();
        offset              = new Vector3(transform.position.x, transform.position.y - 1f, transform.position.z);
        isCreated           = true;
        PlayerControlActive = false;
        isOnMountain        = true;
        arrowColourR        = 1f;
        arrowColourG        = 0f;
        VisibleAimLine      = lineRendererAim.GetComponent <LineRenderer>();
        AddGoatCam          = true;
        m_AudioSource       = GetComponent <AudioSource>();
        aboutToLand         = false;
        collDone            = false;
        arduinoScript       = instance.gameObject.GetComponentInChildren <AriunoListener>();
        rankingAquired      = false;

        LaunchCharged = LaunchChargedParticles.GetComponent <ParticleSystem>();

        jumpChargeTime = UnityEngine.Random.Range(0.1f, 1f);    // used instead of arduino since no access to it right now

        MountainStartPoint = new Vector3(transform.localPosition.x, transform.localPosition.y, transform.position.z);
        MountainEndPoint   = new Vector3(-3.4f, 407.8f, 0f); // OLD Z was 11.2
        MountainMidPoint   = new Vector2(80, 139);
        MountainPoints[0]  = new Vector3(transform.localPosition.x, transform.localPosition.y, transform.localPosition.z);
    }
Exemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     instance = GameObject.FindGameObjectWithTag("PlayerManager").GetComponent <PlayerInstanceGenerator>();
 }