示例#1
0
 public override void Init(MasterSystem masterSystem, SceneManagerData data)
 {
     base.Init(masterSystem, data);
     data.playerController.InitializeUIManager(this);
     foreach (var panel in uiPanels)
     {
         panel.Initialize(masterSystem);
     }
     ChangeInitializationState(ManagerInitializationState.COMPLETED);
 }
    public override void Init(MasterSystem masterSystem, SceneManagerData data)
    {
        base.Init(masterSystem, data);

        CollectSceneEntities();
        foreach (var entity in entites)
        {
            if (entity == null)
            {
                Debug.LogError("[EntitySceneManager]: one of the entities is null");
                return;
            }

            InitEntity(entity);
        }

        ChangeInitializationState(ManagerInitializationState.COMPLETED);
    }
示例#3
0
    public override void Init(MasterSystem masterSystem, SceneManagerData data)
    {
        base.Init(masterSystem, data);

        projectileManager = masterSystem.TryGetManager <ProjectileManager>(SceneManagerType.Projectile);
        if (projectileManager == null)
        {
            Debug.LogError("[ItemSceneSystem]: tried to get projectileManager but it wasn't initialized");
            return;
        }

        CollectSceneItems();
        foreach (var item in items)
        {
            item.Initialize(data.player, data.playerController, projectileManager);
        }

        ChangeInitializationState(ManagerInitializationState.COMPLETED);
    }
示例#4
0
    public override void Init(MasterSystem masterSystem, SceneManagerData data)
    {
        base.Init(masterSystem, data);

        projectiles = new Dictionary <ProjectileType, GameObject>();
        for (int i = 0; i < projectileGameObjects.Length; i++)
        {
            var p = projectileGameObjects[i];
            var projectileComponent = p.GetComponent <Projectile>();
            if (projectileComponent == null)
            {
                Debug.LogError("[ProjectileManager]: projectile component not found in game object");
                ChangeInitializationState(ManagerInitializationState.FAILED);
                return;
            }

            for (int j = 0; j < projectileGameObjects.Length; j++)
            {
                if (i == j)
                {
                    continue;
                }

                var otherProjectileComponent = projectileGameObjects[j].GetComponent <Projectile>();
                if (otherProjectileComponent == null)
                {
                    continue;
                }

                if (projectileComponent.Type() == otherProjectileComponent.Type())
                {
                    Debug.LogError($"[ProjectileManager]: two projectiles with same projectile type found '{projectileComponent.Type().ToString()}' - this should not happen");
                    ChangeInitializationState(ManagerInitializationState.FAILED);
                    return;
                }
            }
            projectiles.Add(projectileComponent.Type(), p);
        }

        ChangeInitializationState(ManagerInitializationState.COMPLETED);
    }
示例#5
0
 public virtual void Init(MasterSystem masterSystem, SceneManagerData data)
 {
     initializationState = ManagerInitializationState.IN_PROGRESS;
     this.data           = data;
 }