void Start() { // We fetch all Text components now so that we don't have to keep fetching them later. foreach (CHARACTER character in Enum.GetValues(typeof(CHARACTER))) { dialogueTexts[(int)character] = dialoguePanels[(int)character].GetComponent <Text>(); } choiceText1 = choicePanel1.GetComponent <Text>(); choiceText2 = choicePanel2.GetComponent <Text>(); // Turn off all dialogue boxes and the prompt box. foreach (GameObject panel in dialogueBoxes) { panel.SetActive(false); } promptBox.SetActive(false); anyKeyForMainMenu.SetActive(false); // only show this after "Thank for Playing" fades in conversationSections = DialogueLoader.conversationsBySection(); animationManager = animatorObject.GetComponent <CharacterAnimationManager>(); launchFirstValidConversation(conversationSections[(int)currentDialogueSection]); }
override protected void Start() { base.Start(); inst_Camera = CameraManager.getInstance(); inst_Input = InputManager.getInstance(); inst_Anim = CharacterAnimationManager.getInstance(); s_navAgent = GetComponent <NavMeshAgent>(); s_characterController = GetComponent <CharacterController>(); inst_Input.OnStand += OnIdle; inst_Input.OnTranslate += OnTranslate; inst_Input.OnTranslate += (_, __) => NavigationCancel(); inst_Input.OnJump += OnJump; inst_Input.mouseLeftClickDown += OnSecondSkill; //inst_Input.firstSkill += OnFirstSkill; //inst_Input.secondSkill += OnSecondSkill; inst_Input.combinationSkill += OnCombinationSkill; s_navAgent.updatePosition = false; s_navAgent.updateRotation = false; if (GameObject.FindWithTag("HPBar") == null) { return; } hpBar = GameObject.FindWithTag("HPBar").GetComponent <Slider>(); gameOver = GameObject.Find("GameOver"); gameOver.SetActive(false); }
void Start() { CanFire = true; player = GameObject.Find(Character.PLAYER); //laser_flash = fireposition.GetComponent<Light>(); //laser_flash.intensity = 0f; weapon_dict = new Dictionary <int, Weapon>() { { Weapon.AUTORIFLE, new AutoRifle() }, { Weapon.SHOTGUN, new Shotgun() }, { Weapon.LASERCANNON, new LaserCannon() } }; grenade = Resources.Load <GameObject>("Prefabs/Weapons/grenade"); explosion = Resources.Load <GameObject>("Prefabs/Explosions/Explosion"); audio_sources = GetComponents <AudioSource>(); anim = GameObject.Find(Character.PLAYER).GetComponentInChildren <Animator>(); cam = GameObject.Find(Character.PLAYER).GetComponentInChildren <CharacterAnimationManager>(); m_cm = GameObject.Find(Character.PLAYER).GetComponentInChildren <CharacterMovement>(); SwitchWeapon(Weapon.AUTORIFLE); }
internal void PlayEyeAnimation(CharacterAnimationManager.NameAnimationsList nameAnimated) { timer = 0; eye_anim.Play(nameAnimated.ToString()); _isPlayingAnimation = true; eye_anim.animationCompleteDelegate = delegate(tk2dAnimatedSprite sprite, int clipId) { _isPlayingAnimation = false; }; }
protected virtual void Start() { inst_Animation = CharacterAnimationManager.getInstance(); inst_Input = InputManager.getInstance(); inst_toolTipUI = InterationToolTip.getInstance(); bundle = new InteractionEventBundle { eventOwner = this, startAction = OnInteractionStart, cancelAction = OnInteractionCancel }; }
private void Awake() { if (instance == null) { instance = this; } if (instance != this) { DestroyImmediate(this); } DontDestroyOnLoad(this); }
public Player(GameObject character_object) { m_playerobject = character_object; cam = m_playerobject.GetComponentInChildren <CharacterAnimationManager>(); wm = m_playerobject.GetComponent <WeaponManager>(); cm = m_playerobject.GetComponent <CharacterMovement>(); subtractionBar = GameObject.Find("Canvas/StatusBar/SubtractionBar").GetComponent <RectTransform>(); health_bar = GameObject.Find("Canvas/StatusBar").GetComponent <HealthBarScript>(); subtractionBar.localScale = new Vector3(0f, 1f, 1f); m_char_name = "player"; m_health = MaxHealth; m_interpspeed = 0.02f; m_isStanding = true; }
// Use this for initialization void Start() { _anim = GetComponent <CharacterAnimationManager>(); }
private void PlayRightHandAnimation(CharacterAnimationManager.NameAnimationsList nameAnimated) { righthand_anim.Play(nameAnimated.ToString()); }