Esempio n. 1
0
    /// <summary>
    /// Returns the dead.
    /// 放回死亡模型资源
    /// </summary>
    /// <param name="go">Go.</param>
    public void ReturnDead(GameObject go)
    {
        if (go == null)
        {
            return;
        }
        ComponentChoppedBody ed = go.GetComponent <ComponentChoppedBody>();

        ed.Disable();

        int len = DeadCaches.Length;

        for (int i = 0; i < len; i++)
        {
            if (DeadCaches[i].Return(go) == true)
            {
                return;
            }
        }
    }
Esempio n. 2
0
    /// <summary>
    /// Gets the dead.
    /// 获取死亡模型资源
    /// </summary>
    public GameObject GetDead(Agent agent, E_DeadBodyType deadType)
    {
        int        len = DeadCaches.Length;
        GameObject go;

        for (int i = 0; i < len; i++)
        {
            if (DeadCaches[i].EnemyType == agent.EnemyType)
            {
                go = DeadCaches[i].Get(deadType);
                if (go != null)
                {
                    ComponentChoppedBody ed = go.GetComponent <ComponentChoppedBody>();
                    ed.Enable(agent.transform);
                }
                return(go);
            }
        }
        return(null);
    }