Esempio n. 1
0
 /// <summary>
 /// Unity Function. Called once upon creation of the object.
 /// </summary>
 void Awake()
 {
     ringleaderMovement   = GetComponent <RingleaderMovement> ();
     enemyHealth          = GetComponent <RingleaderHealth> ();
     ringleaderAnimatable = GetComponent <RingleaderAnimatable> ();
     ringleaderController = GetComponent <RingleaderController>();
 }
Esempio n. 2
0
    /// <summary>
    /// Standard Unity Function. Called once in the game object's lifetime to initiate the script once it has been enabled.
    /// </summary>
    void Start()
    {
        yuniPos = FindObjectOfType <PlayerYuni> ().transform;

        this.ringleaderAnimatable = gameObject.GetComponent <RingleaderAnimatable> ();
        General.CheckIfNull(ringleaderAnimatable, "ringleaderAnimatable", scriptName);
    }
Esempio n. 3
0
 /// <summary>
 /// Unity Function. Called once upon creation of the object.
 /// </summary>
 void Awake()
 {
     rectTransform        = GetComponent <RectTransform> ();
     teleporter           = GetComponent <Teleport> ();
     targetPos            = transform.position;
     ringleaderAnimatable = GetComponent <RingleaderAnimatable> ();
     if (hazard == null)
     {
         hazard = GetComponentInChildren <RingleaderNormalAttackHazard> ();
     }
 }
Esempio n. 4
0
    /// <summary>
    /// Standard Unity Function. Called once every frame.
    /// </summary>
    void Update()
    {
        if (ringleaderAnimatable == null)
        {
            this.ringleaderAnimatable = gameObject.GetComponent <RingleaderAnimatable> ();
        }

        yuniPos      = this.GetPlayer().gameObject.transform;
        latestTarget = new Vector2(yuniPos.position.x, yuniPos.position.y);
        Random.Range(0, 2);
    }
Esempio n. 5
0
    /// <summary>
    /// Unity Function. Called once upon creation of the object.
    /// </summary>
    void Awake()
    {
        ringleaderController = GetComponent <RingleaderController>();
        ringleaderAnimatable = GetComponent <RingleaderAnimatable> ();
        EventBroadcaster.Instance.AddObserver(EventNames.INVULNERABLE_ENEMIES, this.Invulnerable);
        EventBroadcaster.Instance.AddObserver(EventNames.VULNERABLE_ENEMIES, this.Vulnerable);

        Parameters data = new Parameters();

        data.PutExtra("enemyHealth", this);
        EventBroadcaster.Instance.PostEvent(EventNames.REGISTER_ENEMY, data);
    }
Esempio n. 6
0
    void Start()
    {
        gameObject.tag = "Enemy";
//		Random.InitState (17398);
//		direction *= (int) (transform.localScale.x / Mathf.Abs (transform.localScale.x));
        Debug.Log("Start Direction: " + direction);
        throwForce = new Vector2(WEAK * direction, WEAK);
//		Vector2 throwDirection = new Vector2 (throwForce.x * -direction, throwForce.y);
//		throwForce = throwDirection;


        this.ringleaderAnimatable = gameObject.GetComponent <RingleaderAnimatable> ();
        General.CheckIfNull(ringleaderAnimatable, "ringleaderAnimatable", scriptName);
    }