示例#1
0
 public static void Initialize()
 {
     currentLevel = 1;
     GlobalMediator.AddListener(RecieveEvents);
     cam            = UnityEngine.Object.FindObjectOfType <Camera>().gameObject;
     firstLevelYPos = cam.transform.position.y;
 }
 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);
 }
示例#5
0
 public override void Initialize(int playerNumber)
 {
     base.Initialize(playerNumber);
     rigi        = GetComponent <Rigidbody2D>();
     chargePower = minChargePower;
     GlobalMediator.AddListener(this);
     chargeDisplay.gameObject.SetActive(false);
 }
示例#6
0
    public override void Initialize(int playerNumber)
    {
        base.Initialize(playerNumber);
        allowedToMove = false;
        InputManager.SetPlayerNumberUpdateDevice(playerNumber, InputManager_OnChanges);
        InputManager_OnChanges();

        GlobalMediator.AddListener(RecieveEvents);
    }
示例#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();
    }
示例#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);
     }
 }
 private void Start()
 {
     currenthealth = maxHealth;
     GlobalMediator.AddListener(this);
 }
 public static void Initialize()
 {
     GlobalMediator.AddListener(RecieveEvents);
 }
示例#11
0
 private void OnEnable()
 {
     GlobalMediator.AddListener(this);
 }
示例#12
0
 public override void Initialize(int playerNumber)
 {
     base.Initialize(playerNumber);
     rb = GetComponent <Rigidbody2D>();
     GlobalMediator.AddListener(this);
 }
示例#13
0
 public override void Initialize(int playerNumber)
 {
     base.Initialize(playerNumber);
     collider2d = GetComponent <Collider2D>();
     GlobalMediator.AddListener(this);
 }
示例#14
0
 public override void Initialize(int playerNumber)
 {
     base.Initialize(playerNumber);
     GlobalMediator.AddListener(this);
 }
示例#15
0
 public static void Initialize()
 {
     GlobalMediator.AddListener(OnMediatorMessage);
 }
示例#16
0
 public static void Initialize()
 {
     GlobalMediator.AddListener(PlaySoundEvent);
     targetObject = new GameObject("@Wwise Audio Target");
 }
示例#17
0
 public static void Initialize()
 {
     timer = 0;
     GlobalMediator.AddListener(RecieveEvent);
 }
示例#18
0
 void Start()
 {
     playersInGoal = 0;
     active        = true;
     GlobalMediator.AddListener(RecieveEvents);
 }