Exemple #1
0
 public void ChangeModel(PlayerControl.PlayerType _type)
 {
     Debug.Log("name=" + gameObject.name + "  type=" + _type.ToString());
     if (_type == PlayerControl.PlayerType.Cat)
     {
         m_CatObj.SetActive(true);
         m_GhostObj.SetActive(false);
         mAnimatorController = mCatAni;
     }
     else
     {
         m_CatObj.SetActive(false);
         m_GhostObj.SetActive(true);
         mAnimatorController = mGhostAni;
     }
 }
    public void SetMaterial(PlayerControl.PlayerType type, int _index, GameObject obj)
    {
        var mesh = obj.GetComponentInChildren <SkinnedMeshRenderer>();

        if (mesh == null)
        {
            return;
        }

        string path = "";

        if (type == PlayerControl.PlayerType.Ghost)
        {
            path = "Material/Catg00" + _index + "_A";
        }
        else
        {
            path = "Material/Cat00" + _index + "_A";
        }

        mesh.material = Resources.Load <Material>(path);
    }