Esempio n. 1
0
    /*********************
    * ALL OTHER FUNCTIONS
    *********************/
    public void SetupRound()
    {
        // Link all objects
        m_HUD = GameObject.Find("HUD");
        m_HUD.transform.Find("ScoreIndicators").GetComponent <ScoreUIManager>().Init();
        m_AI_Manager = GameObject.FindGameObjectWithTag(GLOBAL_VALUES.TAG_AI_MANAGER).GetComponent <AI_Manager>();
        uiClock      = GameObject.Find("ClockTimer").GetComponent <UITimer>();

        source          = m_HUD.GetComponent <AudioSource>();
        m_ItemManager   = m_HUD.gameObject.GetComponent <ItemManager>();
        m_SaleManager   = new SaleManager(m_ItemManager);
        m_CameraManager = new CameraManager(this, m_GameManager);
        m_CameraManager.SetActiveCamera(GameObject.Find("Main Camera").GetComponent <Camera>());
        m_CameraManager.SetupScene();
        m_UIClock_Text = GameObject.Find("TimerText").GetComponent <Text>();
        m_ScoreScreen  = new ScoreScreenManager(this, m_GameManager);
        SpawnPlayers();
        m_ClockAnimation = false;
        m_Countdown      = GameObject.Find("CountDown");
        m_Countdown.SetActive(false);
        m_EndLights = new List <SpinningLight>();
        foreach (GameObject light in GameObject.FindGameObjectsWithTag("LIGHTS_END"))
        {
            m_EndLights.Add(light.GetComponent <SpinningLight>());
        }
        m_endlightsStarted = false;
        foreach (AgentManager a in m_GameManager.Get_Players())
        {
            //a.Get_Powerup_Manager().Setup_Camera_Manager(m_CameraManager);
            a.Setup_Item_Manager(m_ItemManager);
            a.GetPunchControl().SetEffectColour();
        }
        SetupComplete = true;
    }
    private void Start()
    {
        m_aiManager    = AI_Manager.Instance;
        m_scoreManager = ScoreManager.Instance;
        // array for awards
        var myCodes = new int[5];

        myCodes[0] = 150;
        myCodes[1] = 200;
        myCodes[2] = 250;
        myCodes[3] = 300;
        myCodes[4] = 350;
        var index = Random.Range(0, myCodes.Length);

        GraveAward = myCodes[index];

        // is this a spooky treasure?
        SpookyTreasureRandomNumber = Random.Range(0, 100);
        if (SpookyTreasureRandomNumber <= PercentChanceForSpookyTreasure)
        {
            isThisTreasureSpooky = true;
        }
        else
        {
            isThisTreasureSpooky = false;
        }


        // current health = max health at start
        GraveCurrentHealth = GraveMaxHealth;
        //disable spooky treasure text on start
        SpookyTreasureText.SetActive(false);
    }
    public override void Move(Animator a, Rigidbody2D rb, AI_Manager AM)
    {
        Vector3 moveVec3 = rb.velocity;

        moveVec3.x  = AM.GetMoveSpeed() * Time.deltaTime * 3.5f; // 이동속도 * 프레임 * 대쉬 속도
        rb.velocity = (moveVec3);
    }
Esempio n. 4
0
 protected void OnDestroy()
 {
     if (singleton == this)
     {
         singleton = null;
     }
 }
Esempio n. 5
0
 public static void Add(AI_Unit unit)
 {
     if (_instance == null)
     {
         _instance = new GameObject("AI_Manager").AddComponent <AI_Manager>();
     }
     _units.Add(unit);
 }
Esempio n. 6
0
 private void Start()
 {
     m_navAgent           = GetComponent <GridNavigation_Agent>();
     m_movementController = GetComponent <Entity_MovementController>();
     m_aiManager          = AI_Manager.Instance;
     m_navAgent.m_navGrid = m_aiManager.m_navGrid;
     m_spookyTimeManager  = SpookyTimeManager.Instance;
     StartCoroutine(PlaySpawnSound());
 }
Esempio n. 7
0
 // Use this for initialization
 void Start()
 {
     if (_Main != null)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _Main = this;
     }
 }
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* New Method: Destroy Game Objects
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    private void DestroyGameObjects()
    {
        List <GameObject> lObjs = GetObjects();

        foreach (GameObject Obj in lObjs)
        {
            Destroy(Obj);
        }

        // Destroy Active AI's
        AI_Manager.DestroyAllActiveAIs(m_DestroyAllActiveExplosiveUnits, m_DestroyAllActiveTurretUnits, m_DestroyAllActiveBrainBugUnits, m_DestroyAllActiveLightUnits, m_DestroyAllActiveHeavyUnits);
    }
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* New Method: Is a Platform Being Targeted By Another Romling?
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    protected static bool PlatformTargetedByAnotherRomling(GameObject Target)
    {
        List <Enemy_Romling> lRomlings = AI_Manager.GetRomlingEnemies();

        foreach (Enemy_Romling pRomling in lRomlings)
        {
            if (pRomling.m_PlatformBreakStructure.goTargettedPlatform == Target)
            {
                return(true);
            }
        }
        return(false);
    }
Esempio n. 10
0
    void Start()
    {
        //refs to self and daddy
        this.navAgent  = this.GetComponent <NavMeshAgent>();
        this.zomboMov  = this.GetComponent <ZomboMovement>();
        this.zomboAtk  = this.GetComponent <ZomboAttack>();
        this.aiManager = GameObject.FindGameObjectWithTag("Manager").GetComponent <AI_Manager>();

        if (aiManager == null)
        {
            Debug.Log("ERROR: Can't find AI manager. SOURCE: " + this.transform.name);
        }
    }
Esempio n. 11
0
 protected void Awake()
 {
     if (singleton == null)
     {
         singleton = this;
         DontDestroyOnLoad(singleton);
         init();
     }
     else
     {
         Destroy(this);
     }
 }
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //	* New Method: Update Platform Destruction
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    protected void UpdatePlatformDestruction()
    {
        switch (m_PlatformBreakStructure.ePlatformDestroyState)
        {
        case PlatformDestroyState.STALLING:
        {
            m_PlatformBreakStructure.ttStallTimer.Update();
            if (m_PlatformBreakStructure.ttStallTimer.TimeUp())
            {
                m_PlatformBreakStructure.ePlatformDestroyState = PlatformDestroyState.DESTROYING;
                GetAnimator().SetBool(GetParamHashIDs().DestroyPlatformParamID, true);
                GetAnimator().SetBool(GetParamHashIDs().DestroyPlatformStallingParamID, false);
            }
            break;
        }

        case PlatformDestroyState.DESTROYING:
        {
            if (m_bDestroyPlatformEvent)
            {
                TurnOffPlatformDestroy();

                if (m_PlatformBreakStructure.goTargettedPlatform != null)
                {
                    m_PlatformBreakStructure.goTargettedPlatform.GetComponent <TileDisplay>().BreakPlatform();

                    GameObject goLevelMap = GameObject.Find("Level Map");
                    if (goLevelMap != null)
                    {
                        AI_Manager.ResetEnemySpecialties(m_iPlatformCollisionID);
                        goLevelMap.GetComponent <PlatformCollisionBoxes>().ResetPlatformColliders();
                    }
                }
            }
            break;
        }

        default:
        {
            break;
        }
        }
    }
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* New Method: Add Self to AI Manager
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 protected virtual void AddSelfToAIManager()
 {
     AI_Manager.SetupNewAI(this);
 }
Esempio n. 14
0
 public abstract void Move(Animator a, Rigidbody2D b, AI_Manager AM);
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* New Static Method: Unfreeze Level
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 public static void UnFreezeLevel()
 {
     sm_bFrozenLevel = false;
     AI_Manager.UnFreezeAllEnemies();
     Time.timeScale = 1.0f;
 }
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* New Static Method: Freeze Level
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 public static void FreezeLevel()
 {
     sm_bFrozenLevel = true;
     AI_Manager.FreezeAllEnemies();
     Time.timeScale = 0.01f;
 }
Esempio n. 17
0
 public override void Move(Animator a, Rigidbody2D rb, AI_Manager AM)
 {
     Debug.Log("BACK_JUMP DESU!!");
 }
    //private string dummyString;

    void Start()
    {
        this.aiManager = this.GetComponent <AI_Manager>(); //Do this for other managers as well.
        this.uiManager = this.GetComponent <UI_Manager>();
    }
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* Derived Method: On Destroy
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 protected virtual void OnDestroy()
 {
     AI_Manager.RemoveAI(EnemyID);
 }
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* Derived Method: Awake
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 protected virtual void Awake()
 {
     m_TransInterInstance = new TransformInterpreter(this);
     m_iEnemyID           = AI_Manager.Add_AI(this);
 }
Esempio n. 21
0
 private void Start()
 {
     Instance = this;
     StartCoroutine(SpawnInitialGhosts());
 }
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* Redefined Method: On Destroy     (Deconstructor)
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 protected virtual void OnDestroy()
 {
     AI_Manager.DestroyElement(m_ID);
 }
Esempio n. 23
0
 public void Move(Animator a, Rigidbody2D rb, AI_Manager AM)
 {
     _Move.Move(a, rb, AM);
 }
Esempio n. 24
0
 private void OnEnable()
 {
     AI_Manager.Add(this);
     _chooseNewAction  = true;
     transform.forward = new Vector3(Random.value - 0.5f, 0, Random.value - 0.5f);
 }
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //	* New Method: Reset Static Classes
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 public static void ResetStaticClasses()
 {
     AI_Manager.Reset();
     DynamicUpdateManager.Reset();
 }
Esempio n. 26
0
 private void OnDisable()
 {
     AI_Manager.Remove(this);
 }