コード例 #1
0
ファイル: Game.cs プロジェクト: wasifferoze/GGJ_game
        void Awake()
        {
            InitCollisionManager();
            InitLevelGenerationManager();
            InitializePawnSpawnManager();

            var winUnityEvent = new UnityEvent();

            winUnityEvent.AddListener(new UnityAction(OnWinCallback));
            OnWin.AddListener(winUnityEvent);

            var dieUnityEvent = new UnityEvent();

            dieUnityEvent.AddListener(new UnityAction(OnDieCallback));
            OnWin.AddListener(dieUnityEvent);
        }
コード例 #2
0
        protected override void Init()
        {
            var slingShootUnityEvent = new UnityEvent();

            slingShootUnityEvent.AddListener(new UnityAction(OnSlingShoot));
            SlingShootEvent.AddListener(slingShootUnityEvent);

            var energyDepletedUnityEvent = new UnityEvent();

            energyDepletedUnityEvent.AddListener(new UnityAction(OnEnergyDepleted));
            EnergyDepletedEvent.AddListener(energyDepletedUnityEvent);

            var winUnitytEvent = new UnityEvent();

            winUnitytEvent.AddListener(new UnityAction(OnWin));
            WinEvent.AddListener(winUnitytEvent);

            OnInfectiousChange += new System.Action <bool>((isInfected) =>
            {
                if (isInfected)
                {
                    InfectedEvent.Invoke();
                }
                else
                {
                    DeinfectedEvent.Invoke();
                }
            });
        }
コード例 #3
0
        private void Start()
        {
            UnityEvent OnWinEvent = new UnityEvent();

            OnWinEvent.AddListener(new UnityAction(OnWin));
            WinEvent.AddListener(OnWinEvent);

            UnityEvent OnDefeatEvent = new UnityEvent();

            OnDefeatEvent.AddListener(new UnityAction(OnDefeat));
            DefeatEvent.AddListener(OnDefeatEvent);
        }
コード例 #4
0
        private void Start()
        {
            UnityEvent OnWinEvent = new UnityEvent();

            OnWinEvent.AddListener(new UnityAction(OnWin));
            WinEvent.AddListener(OnWinEvent);

            UnityEvent OnInfectedEvent = new UnityEvent();

            OnInfectedEvent.AddListener(new UnityAction(OnInfected));
            InfectedEvent.AddListener(OnInfectedEvent);

            UnityEvent OnDeinfectedEvent = new UnityEvent();

            OnDeinfectedEvent.AddListener(new UnityAction(OnDeinfected));
            DeinfectedEvent.AddListener(OnDeinfectedEvent);

            Energy.Value = 1.0f;
            StartCoroutine(UpdateEnergyValue());
        }