public void BuildRun()
        {
            var g = (Instantiate(GameManager) as GameObject).GetComponent <PlayerStatManager>();

            if (isArcade)
            {
                thisArcadeRun = new int[numberOfLevels];
                var temp = StaticUtilities.ShuffleList(AllLevelsBySceneNumber);
                for (int i = 0; i < numberOfLevels; i++)
                {
                    thisArcadeRun[i] = temp[i];
                }
                g.Levels          = thisArcadeRun;
                g.numberOfPlayers = isTwoPlayer ? 2 : 1;
                g.LoadNextLevel();
            }
            else
            {
                numberOfLevels = Mathf.Clamp(numberOfLevels, 1, 3);
                thisVersusRun  = new int[numberOfLevels];
                var temp = StaticUtilities.ShuffleList(VersusLevels);
                for (int i = 0; i < numberOfLevels; i++)
                {
                    thisVersusRun[i] = temp[i];
                }
                g.Levels          = thisVersusRun;
                g.numberOfPlayers = 2;
                g.LoadNextLevel();
            }
        }
Beispiel #2
0
        void OnEnable()
        {
            if (agent == null)
            {
                agent = GetComponent <PolyNavAgent>();
            }
            Target               = null;
            isAttacking          = false;
            rigidbody2D.velocity = Vector2.zero;
            HP = MaxHp;
            //InvokeRepeating("AssessTarget", 0.1f, 0.5f);
            BuildPatrolPoints();
            //Debug.Log(PatrolPoints);
            PatrolPoints = StaticUtilities.ShuffleList(PatrolPoints);

            //agent.SetDestination(PatrolPoints[0].position);
        }