Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        playerAgent = GetComponent <NavMeshAgent>();
        squireLayer = LayerMask.GetMask("SquireLayer");
        speed       = 10f;
        animator    = GetComponentInChildren <Animator>();

        thisRB          = GetComponent <Rigidbody>();
        thisCC          = GetComponent <CapsuleCollider>();
        randomDirection = Random.Range(0, 11);
        respawning      = GameObject.FindGameObjectWithTag("Knight").GetComponent <KnightCheckpointScript>();

        frozen = false;
        tilt   = false;
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        knightMovement = GameObject.FindGameObjectWithTag("Knight").GetComponent <KnightMovementScript>();
        squireMovement = GameObject.FindGameObjectWithTag("Player").GetComponent <SquireMovementScript>();
        knightRespawn  = GameObject.FindGameObjectWithTag("Knight").GetComponent <KnightCheckpointScript>();
        knightMR       = knightMovement.gameObject.GetComponentsInChildren <MeshRenderer>();
        squireMR       = squireMovement.gameObject.GetComponentsInChildren <MeshRenderer>();

        breathParticles = transform.Find("Dragon Breath").gameObject;

        isFreezeCubes = false;

        theCamera = Camera.main.GetComponent <CameraTouchInputScript>();

        timer        = 22.9f;
        isFire       = false;
        isPlayedSFX  = true;
        roarDuration = breathDuration + 1f;
        beginTilt    = false;
        PS           = transform.GetComponentsInChildren <ParticleSystem>();
    }
Ejemplo n.º 3
0
    void Start()
    {
        originalCameraSize = Camera.main.orthographicSize;
        cameraScript       = Camera.main.GetComponent <CameraTouchInputScript>();

        ThrowingWhat = ItemType.Shield;

        knightLayers     = new GameObject[3];
        knightLayers[0]  = GameObject.Find("Knight Layer");
        knightLayers[1]  = GameObject.Find("Knight Layer 1");
        knightLayers[2]  = GameObject.Find("Knight Layer 2");
        knightCheckpoint = GameObject.FindGameObjectWithTag("Knight").GetComponent <KnightCheckpointScript>();

        buttonsNeeded    = new Button[4];
        buttonsNeeded[0] = GameObject.Find("LowerFloorButton").GetComponent <Button>();
        buttonsNeeded[1] = GameObject.Find("UpperFloorButton").GetComponent <Button>();
        buttonsNeeded[2] = GameObject.Find("ShieldUseButton").GetComponent <Button>();
        buttonsNeeded[3] = GameObject.Find("FlashUseButton").GetComponent <Button>();

        knight = GameObject.FindGameObjectWithTag("Knight");

        shieldAmount  = 1;
        flashAmount   = 2;
        isAiming      = false;
        timeStop      = false;
        preparedField = false;

        cameraPos = Camera.main.transform.localPosition;
        cameraRot = Camera.main.transform.localEulerAngles;

        rotateChecks = new bool[3];

        for (int r = 0; r < rotateChecks.Length; r++)
        {
            rotateChecks[r] = false;
        }
        targetLocked = false;
        isTurning    = false;

        tileLayer  = LayerMask.GetMask("Walkable");
        enemyLayer = LayerMask.GetMask("Enemy");

        //	Shield = GameObject.Find("ShieldSquire");
        //	Shield.SetActive(false);

        //	Flash = GameObject.Find("FlashSquire");
        //	Flash.SetActive(false);

        squireLayer = GameObject.Find("Squire Layer");

        buttonsNeeded[0].gameObject.SetActive(false);
        buttonsNeeded[1].gameObject.SetActive(false);

        GameObject[] gameObjectArray = GameObject.FindObjectsOfType(typeof(GameObject)) as GameObject[];

        for (int a = 0; a < gameObjectArray.Length; a++)
        {
            if (gameObjectArray[a].layer == 8 && gameObjectArray[a].tag != "RotatingBridge" && gameObjectArray[a].tag != "EndPoint")
            {
                floorTiles.Add(gameObjectArray[a]);
                gameObjectArray[a].GetComponent <MeshRenderer>().material.shader = transparent;
            }
        }
    }