Exemplo n.º 1
0
 private void Start()
 {
     slowKeeper = GetComponent <SlowKeeper>();
     if (slowKeeper == null)
     {
         slowKeeper = gameObject.AddComponent <SlowKeeper>();
     }
 }
Exemplo n.º 2
0
    void Start()
    {
        owner = transform;
        oc    = GetComponent <CircleCollider2D>();
        slow  = GetComponent <SlowKeeper>();

        creator = FindObjectOfType <Creator>();
        GameObject timerHolder = new GameObject("TimerHolder");

        timerHolder.transform.parent = this.transform;
        timer = timerHolder.AddComponent <Timer>();
        timer.StartTimer(0);
    }
Exemplo n.º 3
0
    void Awake()
    {
        this.rb         = GetComponent <Rigidbody2D>();
        this.gun        = GetComponent <GunInterface>();
        this.player     = FindObjectOfType <PlayerMover>().gameObject;
        health          = new Health(maxHealth, this);
        this.slowKeeper = FindObjectOfType <SlowKeeper>();
        if (slowKeeper == null)
        {
            slowKeeper = gameObject.AddComponent <SlowKeeper>();
        }

        spriteRenderer    = GetComponent <SpriteRenderer>();
        damageColorVector = VectorColor.ColorToVector(damageColor);
        colorVector       = VectorColor.ColorToVector(spriteRenderer.color);

        lastHit = Mathf.NegativeInfinity;
        DoOnAwake();
    }