コード例 #1
0
 // Use this for initialization
 void Awake()
 {
     SwarmSpawner[] spawnersArr=GameObject.FindObjectsOfType<SwarmSpawner>();
     spawners = new List<SwarmSpawner>(spawnersArr);
     soldierManager = GameObject.FindObjectOfType<SoldierManager>();
     upgradeManager = GameObject.FindObjectOfType<UpgradeManager>();
     foreach (SwarmSpawner spawner in spawners)
     {
         spawner.Attach(this);
         Health health = spawner.GetComponent<Health>();
         health.Attach(this);
         health.Attach(upgradeManager);
     }
 }
コード例 #2
0
ファイル: UpgradeManager.cs プロジェクト: tedmunds/HavokGear
    private void OnEnable()
    {
        instance = this;

        string pathToResources = Application.dataPath + "/" + upgradeDataFolder;

        // Load the upgrade instances
        upgrade_Health = XMLObjectLoader.LoadXMLObjectInternal<Upgrade_Health>(upgradeDataFolder + typeof(Upgrade_Health).Name);
        upgrade_HealthRegen = XMLObjectLoader.LoadXMLObjectInternal<Upgrade_HealthRegen>(upgradeDataFolder + typeof(Upgrade_HealthRegen).Name);
        upgrade_Energy = XMLObjectLoader.LoadXMLObjectInternal<Upgrade_Energy>(upgradeDataFolder + typeof(Upgrade_Energy).Name);
        upgrade_LifeSteal = XMLObjectLoader.LoadXMLObjectInternal<Upgrade_LifeSteal>(upgradeDataFolder + typeof(Upgrade_LifeSteal).Name);

        PlayerState playerState = FindObjectOfType<PlayerState>();
        if(playerState != null) {
            playerState.LoadState();
        }
    }
コード例 #3
0
 void Awake()
 {
     enemyController = GameObject.FindObjectOfType<EnemyController>();
     upgradeManager = GameObject.FindObjectOfType<UpgradeManager>();
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     drunkRect = drunkMask.GetComponent<RectTransform>();
     drunkWidth = drunkRect.sizeDelta.x;
     GamePlayer = Player.instance;
     if (PauseMenu != null)
     {
         PauseMenu.SetActive(false);
     }
     if (GameOverMenu != null)
     {
         GameOverMenu.SetActive(false);
     }
     _upgradeManager = UpgradeManager.instance;
     if (_upgradeManager != null)
     {
         _upgradeManager.DecreaseActiveBoosts();
     }
     StartCoroutine("DifficultyCoroutine");
 }
コード例 #5
0
 // Use this for initialization
 void Awake()
 {
     soldierController = gameObject.GetComponent<SoldierManager>();
     cameraMover = Camera.main.GetComponent<CameraMover>();
     upgradeManager = GameObject.FindObjectOfType<UpgradeManager>().GetComponent<UpgradeManager>();
 }
コード例 #6
0
 // Use this for initialization
 void Start()
 {
     Upgrades = this.gameObject.GetComponent<UpgradeManager>();
 }
コード例 #7
0
ファイル: UpgradeManager.cs プロジェクト: Canonica/RogueLike
 void Awake()
 {
     instance = this;
     DontDestroyOnLoad(gameObject);
     addLevelMax = 3;
        // CreateUpgrade();
 }
コード例 #8
0
    protected override void Start()
    {
        base.Start();

        // Grab some ref to the instances of these global systems
        upgradeManager = UpgradeManager.instance;
        myState = PlayerState.instance;

        playerHUD = GetComponent<UI_PlayerHUD>();
        if(playerHUD == null) {
            Debug.LogWarning("Player does not have HUD component!");
        }

        laserSightRenderer = GetComponent<LineRenderer>();
        laserSightRenderer.enabled = false;

        mechComponent.RegisterDeathListener(OnDied);
    }