Пример #1
0
        public static void Setup()
        {
            LSDatabaseManager.Setup();

            UnityInstance = GameObject.CreatePrimitive(PrimitiveType.Sphere).AddComponent <MonoBehaviour> ();
            UnityInstance.GetComponent <Renderer>().enabled = false;
            GameObject.DontDestroyOnLoad(UnityInstance.gameObject);

            AbilityInterfacer.Setup();

            AgentController.Setup();
            TeamManager.Setup();

            ProjectileManager.Setup();
            EffectManager.Setup();
            BehaviourHelper.GlobalSetup();
            PhysicsManager.Setup();
            ClientManager.Setup(MainGameManager.MainNetworkHelper);
            InterfaceManager.Setup();

            Application.targetFrameRate = 30;
            Time.fixedDeltaTime         = BaseDeltaTime;
            Time.maximumDeltaTime       = Time.fixedDeltaTime * 2;

            InputManager.Setup();

            foreach (LSManager manager in Managers)
            {
                manager.Setup();
            }
        }
Пример #2
0
        internal void Setup(LSAgent agent, int id)
        {
            System.Type mainType = this.GetType();
            if (mainType.IsSubclassOf(typeof(ActiveAbility)))
            {
                while (mainType.BaseType != typeof(ActiveAbility))
                {
                    mainType = mainType.BaseType;
                }
                Interfacer = AbilityInterfacer.FindInterfacer(mainType);

                if (Interfacer == null)
                {
                    throw new System.ArgumentException("The Ability of type " + mainType + " has not been registered in database");
                }
                this.MyAbilityCode = Interfacer.Name;
            }
            else
            {
                this.MyAbilityCode = mainType.Name;
            }
            _agent = agent;
            ID     = id;
            TemplateSetup();
            OnSetup();
            this.VariableContainerTicket = LSVariableManager.Register(this);
            this._variableContainer      = LSVariableManager.GetContainer(VariableContainerTicket);
        }
Пример #3
0
        internal static void Setup()
        {
            DefaultMessageRaiser.EarlySetup();

            LSDatabaseManager.Setup();

            UnityInstance = GameObject.CreatePrimitive(PrimitiveType.Quad).AddComponent <MonoBehaviour>();
            GameObject.Destroy(UnityInstance.GetComponent <Collider>());
            UnityInstance.GetComponent <Renderer>().enabled = false;
            GameObject.DontDestroyOnLoad(UnityInstance.gameObject);

            GridManager.Setup();
            AbilityInterfacer.Setup();

            AgentController.Setup();
            TeamManager.Setup();

            ProjectileManager.Setup();
            EffectManager.Setup();

            PhysicsManager.Setup();
            ClientManager.Setup(MainGameManager.MainNetworkHelper);

            Application.targetFrameRate = 60;
            Time.fixedDeltaTime         = BaseDeltaTime;
            Time.maximumDeltaTime       = Time.fixedDeltaTime * 2;
            InputCodeManager.Setup();


            DefaultMessageRaiser.LateSetup();
        }
Пример #4
0
        static void Setup()
        {
            QuickPos    = AbilityInterfacer.FindInterfacer("Move");
            QuickTarget = AbilityInterfacer.FindInterfacer("Scan");

            Setted = true;
        }
Пример #5
0
 public void ResetTile()
 {
     if (this == null)
     {
         return;
     }
     gameObject.SetActiveIfNot(false);
     _interfacer = null;
 }
Пример #6
0
 public void Setup(LSAgent agent, int id)
 {
     Interfacer = AbilityInterfacer.FindInterfacer(this.GetType());
     if (Interfacer == null)
     {
         throw new System.ArgumentException("This Ability of type " + this.GetType() + " has not been registered in database");
     }
     this.MyAbilityCode = (AbilityCode)Interfacer.MappedCode;
     _agent             = agent;
     ID = id;
     TemplateSetup();
     OnSetup();
 }
Пример #7
0
        public static void Inject(FastList <AbilityInterfacer> interfacers)
        {
            for (int i = 0; i < interfacers.Count; i++)
            {
                AbilityInterfacer facer = interfacers[i];
                int tileIndex           = facer.TileIndex;
                if (Tiles == null || tileIndex >= 12 || tileIndex >= Tiles.Length)
                {
                    continue;
                }

                Tiles[tileIndex].Interfacer = (facer);
            }
        }
Пример #8
0
        private static void ProcessInterfacer(AbilityInterfacer facer)
        {
            switch (facer.InformationGather)
            {
            case InformationGatherType.Position:
                curCom          = new Command(facer.ListenInput);
                curCom.Position = Interfacing.GetWorldPosD(Input.mousePosition);
                break;

            case InformationGatherType.Target:
                curCom = new Command(facer.ListenInput);
                if (Interfacing.MousedAgent.IsNotNull())
                {
                    curCom.Target = Interfacing.MousedAgent.LocalID;
                }
                break;

            case InformationGatherType.PositionOrTarget:
                curCom = new Command(facer.ListenInput);
                if (Interfacing.MousedAgent.IsNotNull())
                {
                    curCom.Target = Interfacing.MousedAgent.GlobalID;
                }
                else
                {
                    curCom.Position = Interfacing.GetWorldPosD(Input.mousePosition);
                }
                break;

            case InformationGatherType.None:
                curCom = new Command(facer.ListenInput);
                break;
            }
            if (facer.MarkType != MarkerType.None)
            {
                Interfacing.ActivateMarkerOnMouse(facer.MarkType);
            }
            Send(curCom);
        }
Пример #9
0
        private static void ProcessInterfacer(AbilityInterfacer facer)
        {
            switch (facer.InformationGather)
            {
            case InformationGatherType.Position:
                curCom = new Command(facer.ListenInputID);
                curCom.Add <Vector2d> (RTSInterfacing.GetWorldPosD(Input.mousePosition));
                break;

            case InformationGatherType.Target:
                curCom = new Command(facer.ListenInputID);
                if (RTSInterfacing.MousedAgent.IsNotNull())
                {
                    curCom.SetData <DefaultData> (new DefaultData(DataType.UShort, RTSInterfacing.MousedAgent.LocalID));
                }
                break;

            case InformationGatherType.PositionOrTarget:
                curCom = new Command(facer.ListenInputID);
                if (RTSInterfacing.MousedAgent.IsNotNull())
                {
                    curCom.Add <DefaultData> (new DefaultData(DataType.UShort, RTSInterfacing.MousedAgent.GlobalID));
                }
                else
                {
                    curCom.Add <Vector2d> (RTSInterfacing.GetWorldPosD(Input.mousePosition));
                }
                break;

            case InformationGatherType.None:
                curCom = new Command(facer.ListenInputID);
                break;
            }

            Send(curCom);
        }
Пример #10
0
 public static void Setup()
 {
     QuickPos    = AbilityInterfacer.FindInterfacer("Move");
     QuickTarget = AbilityInterfacer.FindInterfacer("Scan");
 }
Пример #11
0
 public static void Setup()
 {
     QuickPos    = AbilityInterfacer.FindInterfacer(Lockstep.Data.AbilityCode.Move);
     QuickTarget = AbilityInterfacer.FindInterfacer(Lockstep.Data.AbilityCode.Scan);
 }