Example #1
0
        // Start is called before the first frame update
        void Start()
        {
            mapManager  = GameObject.FindWithTag("Map Manager").GetComponent <MapManager>();
            gameManager = GameObject.FindWithTag("Game Manager").GetComponent <GameManagerNew>();
            tilemap     = GetComponent <Tilemap>();



            GetTiles(tileList);
        }
Example #2
0
        void Start()
        {
            _Controller        = GetComponent <PlayerControl2>();
            _Sr                = GetComponent <SpriteRenderer>();
            _PlayerCircColl    = transform.GetChild(1).GetChild(0).GetComponent <CircleCollider2D>();
            _PlayerCapsuleColl = transform.GetChild(1).GetChild(0).GetComponent <CapsuleCollider2D>();
            _Special           = GetComponent <Special>();
            _PartSys           = transform.GetChild(2).gameObject.GetComponent <ParticleSystem>();
            _Ball              = GameObject.Find("Ball");
            _animator          = GetComponent <Animator>();
            _gameManager       = GameObject.FindWithTag("Game Manager").GetComponent <GameManagerNew>();

            gravity      = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2);
            normGravTemp = gravity;
            currentScale = transform.localScale;

            //initialize timers
            dashTimer   = 100;
            attackTimer = 100;

            //initialize phase
            phase = state.DEFAULT;
        }