private void Awake() { AvatarControl avatarControl = GetComponent <AvatarControl>(); Init(avatarControl.AvatarPerson); avatarControl.OnAvatarSpawn += Init; }
private void Awake() { AvatarControl avatarControl = GetComponent <AvatarControl>(); InitAnimator(avatarControl.AvatarPerson); avatarControl.OnAvatarSpawn += InitAnimator; avatarControl.OnDefeat += OnDeath; }
public void setHumanMode() { disableModes(); AvatarControl ac = human.getAgent().GetComponent <AvatarControl>(); if (ac != null) { ac.activate(); } human.enableForUser(); containerAgents.sizeDelta = new Vector2(containerAgents.sizeDelta.x, 30f + human.getPanelHeight()); }
private void disableModes() { AvatarControl ac = human.getAgent().GetComponent <AvatarControl>(); if (ac != null) { ac.desactivate(); } robot.disableForUser(); human.disableForUser(); godMode.disableForUser(); }
private void RpcSetAvatar(GameObject avatar, GameObject avatarPerson) { spawnedPlayerAvatar = avatar; spawnedPlayerPerson = avatarPerson; spawnedPlayerPerson.transform.SetParent(spawnedPlayerAvatar.transform); if (isLocalPlayer) { UnityStandardAssets.Utility.FollowTarget camera = GameObject.FindObjectOfType <UnityStandardAssets.Utility.FollowTarget>(); camera.target = spawnedPlayerAvatar.transform; avatarControl = spawnedPlayerAvatar.GetComponent <AvatarControl>(); if (avatarControl != null) { userControlInput.SetAvatarControl(avatarControl); avatarControl.SetAvatarPerson(spawnedPlayerPerson); avatarControl.OnDefeat += YouDefeat; } } }
private void InitAvatar(Vector3 spawnPosition, AvatarType avatarType) { switch (avatarType) { case AvatarType.DODGER: HealthAmount = START_HEALTH; healthBar.gameObject.SetActive(true); break; case AvatarType.SHOOTER: healthBar.gameObject.SetActive(false); break; default: break; } foreach (Renderer renderer in avatarModel.transform.GetComponentsInChildren <Renderer>()) { if (renderer.tag == Tags.TeamColored) { renderer.material.color = Team.Color(); } } avatarModel.transform.SetParent(transform, false); AvatarTypeSettings = avatarType.Settings(); title.text = AvatarTypeSettings.Name; weapon.Init(this); if (photonView.isMine) { AvatarControl avatarControl = gameObject.AddComponent <AvatarControl>(); avatarControl.Init(this, avatarModel, weapon); } transform.position = spawnPosition; gameObject.SetActive(true); }
void Awake() { contenderCanvas = GetComponent <Image> (); avatarControl = GameObject.FindGameObjectWithTag("GameController").GetComponent <AvatarControl> (); }
public void SetAvatarControl(AvatarControl _avatarControl) { avatarControl = _avatarControl; }