コード例 #1
0
    private void Start()
    {
        //This is an emergency thing. It should not ever trigger except in testing environment
        if (ActualSave.actualSave == null)
        {
            ActualSave.actualSave = new SaveFileInfo();
        }

        inputHandler = this.transform.parent.parent.GetComponent <InputHandler>();
        //GameObject.FindGameObjectsWithTag("PersistentObject")[0];
        inputHandler.addObserver(this);
        StartParent    = this.transform.parent;
        playerCollider = this.GetComponent <SphereCollider>();
        emotions       = this.GetComponent <EmotionHandlerScript>();
        // We get the player's rigidbody's component
        player = GetComponent <Rigidbody>();
        ActualSave.actualSave.stats[playerNb].playerRotationSpeed = 0f;
        GameObject[] spawners = GameObject.FindGameObjectsWithTag("Spawn");


        bonusCount = GameObject.FindGameObjectsWithTag("BonusCount")[0].GetComponent <TextMeshProUGUI>();



        defaultGravity = new Vector3(0, -40f, 0);
        follower       = transform.parent.GetComponentInChildren <PlayerCapsuleFollow>();
        swapper        = GetComponent <ElementalPlayerVisualSwapper>();

        nextPowerEmptiesAll = false;
        ActivateTrail(0, false);
        ActivateTrail(1, false);
        ActivateTrail(2, false);
        ActivateTrail(3, false);
    }
コード例 #2
0
    public void OrientPlayer()
    {
        if (follower == null)
        {
            follower = transform.parent.GetComponentInChildren <PlayerCapsuleFollow>();
        }

        follower.AlignViewToSpawn();
        UseDefaultCamera();
    }
コード例 #3
0
    private void Start()
    {
        //This is an emergency thing. It should not ever trigger except in testing environment
        if (ActualSave.actualSave == null)
        {
            ActualSave.actualSave = new SaveFileInfo();
        }

        inputHandler = this.transform.parent.parent.GetComponent <InputHandler>();
        //GameObject.FindGameObjectsWithTag("PersistentObject")[0];
        inputHandler.addObserver(this);
        follower = transform.parent.GetComponentInChildren <PlayerCapsuleFollow>();

        cinemachineBrain.m_DefaultBlend = new CinemachineBlendDefinition(CinemachineBlendDefinition.Style.EaseInOut, 0.7f);
        DampenedFollow = tofollow.position;
        player         = GetComponent <Rigidbody>();
        worldUp        = -Physics.gravity.normalized;
        storedDamping  = defautLookAtDampingValue;
    }