Esempio n. 1
0
    protected override void Awake()
    {
        if (!ShipEquiperGameStatic.GameInitialized)
        {
            base.Awake();

            ships         = new GameObject[shipsNum];
            shipSelectors = new ShipSelector[shipsNum];

            events.Add(EventNameEnum.PrevButtonActivationSwitch, new BoolEvent());
            events.Add(EventNameEnum.NextButtonActivationSwitch, new BoolEvent());
            TEventManager <bool> .AddInvoker(EventNameEnum.PrevButtonActivationSwitch, this);

            TEventManager <bool> .AddInvoker(EventNameEnum.NextButtonActivationSwitch, this);

            TEventManager <bool> .AddListener(EventNameEnum.PrevShipClick, ShowPreviousShip);

            TEventManager <bool> .AddListener(EventNameEnum.NextShipClick, ShowNextShip);

            TEventManager <bool> .AddListener(EventNameEnum.ChoosenShipIsEquipedClick, GoToShipEquippinig);

            TEventManager <bool> .AddListener(EventNameEnum.ButtonsNeedActivationCheck, CheckAndDeactivateArrows);

            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    }
    void Awake()
    {
        if (!ShipEquiperGameStatic.GameInitialized)
        {
            TEventManager <bool> .Initialize();

            ScreenUtils.Initialize();
        }
    }
    private void Start()
    {
        TEventManager <bool> .AddListener(EventNameEnum.SwitchModulesRigBodySimulation, SwitchRigidBodySimulation);

        SRcomp             = GetComponent <SpriteRenderer>();
        RBcomp             = GetComponent <Rigidbody2D>();
        halfColliderWidth  = GetComponent <BoxCollider2D>().size.x / 2;
        halfColliderHeight = GetComponent <BoxCollider2D>().size.y / 2;
    }
Esempio n. 4
0
    void Start()
    {
        if (!ShipEquiperGameStatic.GameInitialized)
        {
            events.Add(EventNameEnum.NextShipClick, new BoolEvent());
            TEventManager <bool> .AddInvoker(EventNameEnum.NextShipClick, this);

            events[EventNameEnum.NextShipClick].Invoke(false);
        }
        else
        {
            events.Add(EventNameEnum.ButtonsNeedActivationCheck, new BoolEvent());
            TEventManager <bool> .AddInvoker(EventNameEnum.ButtonsNeedActivationCheck, this);

            events[EventNameEnum.ButtonsNeedActivationCheck].Invoke(false);
        }
    }
Esempio n. 5
0
    protected override void Awake()
    {
        base.Awake();
        ship_RBcomp = GetComponent <Rigidbody2D>();

        events.Add(EventNameEnum.SwitchModulesRigBodySimulation, new BoolEvent());
        events.Add(EventNameEnum.FullnessChecked, new BoolEvent());
        events.Add(EventNameEnum.ButtonsActivationSwitch, new BoolEvent());
        TEventManager <bool> .AddInvoker(EventNameEnum.SwitchModulesRigBodySimulation, this);

        TEventManager <bool> .AddInvoker(EventNameEnum.FullnessChecked, this);

        TEventManager <bool> .AddInvoker(EventNameEnum.ButtonsActivationSwitch, this);

        TEventManager <bool> .AddListener(EventNameEnum.ChoosenShipIsEquipedClick, LiftShip);

        TEventManager <bool> .AddListener(EventNameEnum.CheckShipsFullness, CheckShipEquiping);
    }
    private void Start()
    {
        events.Add(EventNameEnum.ChoosenShipIsEquipedClick, new BoolEvent());
        events.Add(EventNameEnum.CheckShipsFullness, new BoolEvent());
        TEventManager <bool> .AddInvoker(EventNameEnum.ChoosenShipIsEquipedClick, this);

        TEventManager <bool> .AddInvoker(EventNameEnum.CheckShipsFullness, this);

        TEventManager <bool> .AddListener(EventNameEnum.FullnessChecked, FullnessCheckComplete);

        TEventManager <bool> .AddListener(EventNameEnum.ButtonsActivationSwitch, FinishButtonSwitchActivation);

        message.text          = "Equip your ship";
        messageTimer          = gameObject.AddComponent <Timer>();
        messageTimer.Duration = 2;
        messageTimer.AddTimerFinishedListener(HideMessage);
        messageTimer.Run();
    }