Exemplo n.º 1
0
 public static void Initialize()
 {
     currentLevel = 1;
     GlobalMediator.AddListener(RecieveEvents);
     cam            = UnityEngine.Object.FindObjectOfType <Camera>().gameObject;
     firstLevelYPos = cam.transform.position.y;
 }
Exemplo n.º 2
0
 public static void Initialize()
 {
     shakeObj = new GameObject("@Screenshake Object");
     shakeObj.transform.position = Vector3.zero;
     UnityEngine.Object.FindObjectOfType <Camera>().transform.SetParent(shakeObj.transform, true);
     GlobalMediator.AddListener(RecieveEvents);
 }
    public void Awake()
    {
        initalized  = true;
        filledHeart = Resources.Load <Sprite>("Sprites/HeartFilled");
        emptyHeart  = Resources.Load <Sprite>("Sprites/HeartEmpty");

        p1Hearts = new List <SpriteRenderer>();
        p2Hearts = new List <SpriteRenderer>();

        GlobalMediator.AddListener(RecieveEvents);

        for (int i = 0; i < 3; i++)
        {
            SpriteRenderer heart = Instantiate(new GameObject("p1 heart " + i)).AddComponent <SpriteRenderer>();
            p1Hearts.Add(heart);
        }

        for (int i = 0; i < 3; i++)
        {
            SpriteRenderer heart = Instantiate(new GameObject("p2 heart " + i)).AddComponent <SpriteRenderer>();
            p2Hearts.Add(heart);
        }

        foreach (var item in p1Hearts)
        {
            item.sprite = filledHeart;
            item.gameObject.transform.localScale = Vector3.zero;
        }

        foreach (var item in p2Hearts)
        {
            item.sprite = filledHeart;
            item.gameObject.transform.localScale = Vector3.zero;
        }
    }
 public override void Initialize(int playerNumber)
 {
     base.Initialize(playerNumber);
     GlobalMediator.AddListener(this);
     spriteTrail = GetComponent <SpriteTrail.SpriteTrail>();
     toggleTrail(false);
 }
Exemplo n.º 5
0
 public override void Initialize(int playerNumber)
 {
     base.Initialize(playerNumber);
     rigi        = GetComponent <Rigidbody2D>();
     chargePower = minChargePower;
     GlobalMediator.AddListener(this);
     chargeDisplay.gameObject.SetActive(false);
 }
Exemplo n.º 6
0
    public override void Initialize(int playerNumber)
    {
        base.Initialize(playerNumber);
        allowedToMove = false;
        InputManager.SetPlayerNumberUpdateDevice(playerNumber, InputManager_OnChanges);
        InputManager_OnChanges();

        GlobalMediator.AddListener(RecieveEvents);
    }
Exemplo n.º 7
0
    public override void Initialize(int playerNumber)
    {
        base.Initialize(playerNumber);
        GlobalMediator.AddListener(this);
        spriteRenderer  = GetComponent <SpriteRenderer>();
        foundAnimations = new Dictionary <string, Sprite[]>();
        foundInfo       = new Dictionary <string, UnitAnimationInfo>();


        myCharacter       = playerNumber == 1 ? Character.Blue : Character.Pink;
        myCharacterFolder = (myCharacter is Character.Blue) ? BlueFolder : PinkFolder;


        TryStartAnimation("Idle");
        SetFrameRate("Idle");
        NextFrame();
    }
Exemplo n.º 8
0
 // Start is called before the first frame update
 void Awake()
 {
     allChilren = new List <Transform>();
     foreach (var item in GetComponentsInChildren <Transform>())
     {
         if (item.gameObject == this.gameObject)
         {
             continue;
         }
         allChilren.Add(item);
     }
     GlobalMediator.AddListener(RecieveEvents);
     foreach (var item in allChilren)
     {
         if (item.gameObject == this.gameObject)
         {
             continue;
         }
         item.gameObject.SetActive(false);
     }
 }
Exemplo n.º 9
0
 private void Start()
 {
     currenthealth = maxHealth;
     GlobalMediator.AddListener(this);
 }
Exemplo n.º 10
0
 public static void Initialize()
 {
     GlobalMediator.AddListener(RecieveEvents);
 }
Exemplo n.º 11
0
 private void OnEnable()
 {
     GlobalMediator.AddListener(this);
 }
Exemplo n.º 12
0
 public override void Initialize(int playerNumber)
 {
     base.Initialize(playerNumber);
     rb = GetComponent <Rigidbody2D>();
     GlobalMediator.AddListener(this);
 }
Exemplo n.º 13
0
 public override void Initialize(int playerNumber)
 {
     base.Initialize(playerNumber);
     collider2d = GetComponent <Collider2D>();
     GlobalMediator.AddListener(this);
 }
Exemplo n.º 14
0
 public override void Initialize(int playerNumber)
 {
     base.Initialize(playerNumber);
     GlobalMediator.AddListener(this);
 }
Exemplo n.º 15
0
 public static void Initialize()
 {
     GlobalMediator.AddListener(OnMediatorMessage);
 }
Exemplo n.º 16
0
 public static void Initialize()
 {
     GlobalMediator.AddListener(PlaySoundEvent);
     targetObject = new GameObject("@Wwise Audio Target");
 }
Exemplo n.º 17
0
 public static void Initialize()
 {
     timer = 0;
     GlobalMediator.AddListener(RecieveEvent);
 }
Exemplo n.º 18
0
 void Start()
 {
     playersInGoal = 0;
     active        = true;
     GlobalMediator.AddListener(RecieveEvents);
 }