コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        freezerEffectActivated = new FreezerEffectActivated();
        freezerEffectDuration  = ConfigurationUtils.FreezerDurationSeconds;

        speedUpEffectActivated = new SpeedUpEffectActivated();
        speedUpDuration        = 6;
        speedUpForse           = 20;

        bonusCoins = ConfigurationUtils.PointsForPickupBlock;
        SpriteRenderer spriteRenderer = gameObject.GetComponent <SpriteRenderer>();

        switch (pickupEffect)
        {
        case PickupEffect.Freezer:
            spriteRenderer.sprite = freezBlock;
            EventsManager.AddInvoker(this);
            break;

        case PickupEffect.Speedup:
            spriteRenderer.sprite = speedUpBlock;
            EventsManager.AddInvokerTwo(this);
            break;
        }
    }
コード例 #2
0
 private void Awake()
 {
     EventsManager.AddDamageMadeListener(HandleDamageMadeEvent);
     EventsManager.AddInvoker(this);
 }
コード例 #3
0
 private void Awake()
 {
     EventsManager.AddInvoker(this);
     EventsManager.AddHealthEmptiedListener(HandleHealthEmptiedEvent);
 }