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); }
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(); } }); }
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); }
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()); }