Exemplo n.º 1
0
    void OnTriggerEnter(Collider col)
    {
        if (deaded)
        {
            return;
        }

        ThingStats stats = null;
        Transform  trans = col.gameObject.transform;

        while (stats == null && trans != null)
        {
            stats = trans.GetComponent <ThingStats>();
            trans = trans.parent;
        }

        if (stats != null && stats.gameObject != Firererer)
        {
            if (Firererer != Playerton.i.gameObject && stats.gameObject != Playerton.i.gameObject)             //deadline hax.
            {
                return;
            }

            stats.Hit(damage);

            StartCoroutine(DoDeaded());
            deaded = true;
        }
    }
Exemplo n.º 2
0
    void Awake()
    {
        i      = this;
        ostats = this.GetComponent <ThingStats>();

        foreach (ParticleSystem par in EyeParts)
        {
            par.enableEmission = false;
        }
    }
Exemplo n.º 3
0
    void Awake()
    {
        i = this;
        ostats = this.GetComponent<ThingStats>();

        foreach (ParticleSystem par in EyeParts)
        {
            par.enableEmission = false;
        }
    }
Exemplo n.º 4
0
    public GameObject GetStatsObject()
    {
        if (_stats == null)
        {
            Transform  trans = this.transform;
            ThingStats stats = trans.GetComponent <ThingStats>();

            while (stats == null && trans != null)
            {
                stats = trans.GetComponent <ThingStats>();
                if (stats == null)
                {
                    trans = trans.parent;
                }
            }

            _stats = stats.gameObject;
        }
        return(_stats);
    }