Esempio n. 1
0
 public void ShowChoppedBody(AgentType agentType, Transform trans, ChoppedBodyType1 choppedBodyType)
 {
     for (int i = 0; i < choppedBodies.Count; ++i)
     {
         if (choppedBodies[i].agentType == agentType)
         {
             ChoppedBodyInfo1 bodyInfo = choppedBodies[i];
             for (int ii = 0; ii < bodyInfo.data.Count; ++ii)
             {
                 ChoppedBodyData1 bodyData = bodyInfo.data[ii];
                 if (bodyData.choppedBodyType == choppedBodyType)
                 {
                     ChoppedBody choppedBody = bodyData.pool.Get().GetComponent <ChoppedBody>();
                     choppedBody.Activate(trans);
                 }
             }
         }
     }
 }
Esempio n. 2
0
    public void Collect(GameObject choppedBodyObject, AgentType agentType, ChoppedBodyType1 choppedBodyType)
    {
        if (choppedBodyObject == null)
        {
            return;
        }

        for (int i = 0; i < choppedBodies.Count; ++i)
        {
            if (choppedBodies[i].agentType == agentType)
            {
                ChoppedBodyInfo1 bodyInfo = choppedBodies[i];
                for (int ii = 0; ii < bodyInfo.data.Count; ++ii)
                {
                    ChoppedBodyData1 bodyData = bodyInfo.data[ii];
                    if (bodyData.choppedBodyType == choppedBodyType)
                    {
                        bodyData.pool.Collect(choppedBodyObject);
                    }
                }
            }
        }
    }