private void SetCharacterColor(Transform bodyTran, string colorName, bool isSendRPC = true) { Transform charaBoxTran = bodyTran.FindChild(Common.CO.PARTS_MAIN_BODY); if (charaBoxTran != null) { CharacterColor charaColor = charaBoxTran.GetComponentInChildren <CharacterColor>(); if (charaColor != null) { charaColor.SetColor(colorName); } } }
private void CreateNpcBody() { //メインボディ名取得 string npcName = charaInfo[Common.Character.DETAIL_PREFAB_NAME_NO]; //メインボディ生成 GameObject charaMainObj = PhotonNetwork.Instantiate(Common.Func.GetResourceCharacter(npcName), Vector3.zero, Quaternion.identity, 0); charaMainObj.name = Common.CO.PARTS_BODY; Transform charaMainTran = charaMainObj.transform; //カラー設定 CharacterColor charaColor = charaMainTran.GetComponentInChildren <CharacterColor>(); if (charaColor != null) { charaColor.SetColor(charaInfo[Common.Character.DETAIL_COLOR_NO]); } //メインボディ紐付け charaMainTran.SetParent(myTran, false); charaMainTran.localPosition = Vector3.zero; charaMainTran.rotation = myTran.rotation; }
private void Start() { painter.SetColor(startColor); currentColor.SetColor(startColor); }