private void Awake() { m_PlayerController = GetComponent <PlayerController>(); m_Rigidbody2D = GetComponent <Rigidbody2D>(); m_PlayerFXManager = GetComponent <PlayerFXManager>(); m_PlayerMelee = GetComponent <PlayerMelee>(); m_PlayerThrow = GetComponent <PlayerThrow>(); m_CapsuleCollider2D = GetComponent <CapsuleCollider2D>(); }
[HideInInspector] public PlayerThrow m_Throw; //esto son para poder habilitar y deshabilitar el control una vez que se realizo un lanzamiento, aun que dberia hacerlo de forma iterna public void Setup() //para establecer las referencias y valores inicales //m_Player = Instantiate(m_PlayerPrefab, m_SpawnPosition.position, m_SpawnPosition.rotation) as GameObject;//esta es para la forma 2//sin embargo este escript no es hernecia de MonoBehavior, por lo tanto no tengo la funcion Instantiate, por eso la forma 2 no funciona { m_ColoredPlayerText = "<color=#" + ColorUtility.ToHtmlStringRGB(m_PlayerColor) + ">Jugador " + m_PlayerNumber + "</color>";//parecidoa html m_FinLanzamiento = false; m_Aim = m_Player.GetComponent <PlayerAim>(); m_Throw = m_Player.GetComponent <PlayerThrow>(); m_Throw.m_PlayerNumber = m_PlayerNumber; m_Player.SetActive(false);//todos los jugadores deben iniciar inactivos, los cativara y desactivara el gamemanager cuadno seasu turno }
void Start() { raycastOrigin = GetComponentInChildren <RaycastOrigin>().transform; playerThrow = GetComponent <PlayerThrow>(); SphereCollider c = raycastOrigin.GetComponent <SphereCollider>(); if (c != null) { sphereCastRadius = c.radius; } InteractionButton.HoldEvent += StartPickup; }
//*******************************// // MonoBehaviour Functions // //*******************************// void Start() { m_controllerDeadzone = 0.5f; m_normalTimeScale = Time.timeScale; m_totalHookPoints = new List <Collider2D>(); m_controllerDirection = Vector2.zero; m_input = GetComponent <PlayerInput>(); m_actor = GetComponent <Actor2D>(); m_pm = GetComponent <PlayerMovement>(); m_rb = GetComponent <Rigidbody2D>(); m_pa = GetComponent <PlayerAnim>(); m_pt = GetComponent <PlayerThrow>(); if (m_hookPointVisualization != null) { m_hookPointVisualization.GetComponent <HookPointVisualization>().SetObjectScale(m_hookRadius); } }
public void PlayerThrown(PlayerThrow throwType) { Debug.Log(this.transform.name + " " + throwType + "N!"); }
// Start is called before the first frame update void Start() { playerThrow = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerThrow>(); }