using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class RollerController : MonoBehaviour { public GameObject Player; public Animator Anim; public MeshRenderer MeshPlayer; public MeshRenderer MeshPlayerFemale; public GameObject Roller; public Transform TrCamera; void Start() { } void OnDestroy() { } public void Initializaion(GameObject data) { MeshPlayer.gameObject.SetActive(false); MeshPlayerFemale.gameObject.SetActive(false); Debug.Log("Initializaion " + data); Player = data; switch(Core.Instance.CurGender) { case Core.Gender.Male: MeshPlayer.gameObject.SetActive(true); MeshPlayer.material = data.GetComponentInChildren().material; break; case Core.Gender.Female: MeshPlayerFemale.gameObject.SetActive(true); MeshPlayerFemale.material = data.GetComponentInChildren().material; break; } Anim.SetBool("Move", true); } public void StopRoller() { MeshPlayer.gameObject.SetActive(false); MeshPlayerFemale.gameObject.SetActive(false); Anim.SetBool("Move", false); Roller.SetActive(false); } }