Exemple #1
0
    // Use this for initialization
    void Start()
    {
        orignalPosition = transform.localPosition;
        originalRotation = transform.localRotation;

        originalAngles = transform.rotation.eulerAngles;

        refPoint = null;

        camFocus = GameObject.FindObjectOfType<CameraFocuser>();
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        formManager = GetComponent<FormsManager>();

        gameUI = GameObject.FindGameObjectWithTag("gameUI").transform;
        txtCurTurn = gameUI.FindChild("txtTurn").GetComponent<Text>();
        btnEndTurn = gameUI.FindChild("btnEndTurn").GetComponent<Button>();
        btnEndTurn.onClick.AddListener(() => endTurnBtnClicked());

        ui = GameObject.FindObjectOfType<UIMaster>();

        //grab all enemies from map
        enemiesOnMap = GameObject.FindObjectsOfType<Enemy>();

        camFocus = Object.FindObjectOfType<CameraFocuser>();

        //check for checkpoints
        CheckPointManager.init();
        if (CheckPointManager.GetLevel() == Application.loadedLevel)
        {
            Debug.Log("Using checkpoint");
            CheckPointManager.init();
            GameObject.FindGameObjectWithTag("Player").transform.position = CheckPointManager.GetPosition();
            Debug.Log("Send player to checkpoint at " + CheckPointManager.GetPosition().ToString());
            camFocus.GoTo("PhysicalForm");

        }
    }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        actionPointsLeft = maxActionPoints;
        textureHiderManager = GameObject.FindObjectOfType<TextureHiderManager>();
        gamemaster = GameObject.FindGameObjectWithTag("GameMaster").GetComponent<GameMaster>();
        layerMask = 1 << LayerMask.NameToLayer("Walkable");

        spawnedForms[0] = GameObject.FindGameObjectWithTag("Player");

        //ui
        gameUI = GameObject.FindGameObjectWithTag("gameUI").transform;

        txtActionPoints = gameUI.FindChild("txtActionPoints").GetComponent<Text>();
        btnForm0 = gameUI.FindChild("btnPhysical").GetComponent<Button>();
        btnForm1 = gameUI.FindChild("btnDigital").GetComponent<Button>();
        btnForm2 = gameUI.FindChild("btnOptic").GetComponent<Button>(); txtOptic = gameUI.FindChild("txtOpticControl").gameObject;
        btnCombine = gameUI.FindChild("btnCombine").GetComponent<Button>();

        btnForm2.gameObject.SetActive(gamemaster.opticFormIsAvailable);

        btnForm0.onClick.AddListener(() => formBtnClicked(0));
        btnForm1.onClick.AddListener(() => formBtnClicked(1));
        btnForm2.onClick.AddListener(() => opticControl = true);
        btnCombine.onClick.AddListener(() => combineFormsBtnClicked());

        GameObject physical = spawnedForms[0];
        spawnedForms = new GameObject[spawnableForms.Length];
        spawnedForms[0] = physical;
        //

        curAgent = spawnedForms[0].GetComponent<NavMeshAgent>();
        curAnimator = spawnedForms[0].GetComponent<Animator>();
        pointerLine.SetPosition(0, spawnedForms[0].transform.position);

        camFocus = Object.FindObjectOfType<CameraFocuser>();
        //camFocus.TargetToFollow = spawnedForms[0].transform;

        elapsed = 0f;
        path = new NavMeshPath();

        //Optic form
        if(spawnedOpticForm != null) opticFormScript = spawnedOpticForm.GetComponent<OpticForm>();
        //

        //unstucker
        curUnstuckWait = unstuckWait;
        // /unstucker

        pointerRenderer = pointer.GetComponent<MeshRenderer>();
    }