void Awake() { PV = GetComponent <PhotonView>(); _Ani = GetComponent <PlayerAni>(); _BulletManager = GetComponent <BulletManager>(); cam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); }
public void LoadPlayer() { var player = LoadAndInstaniate(Path.PLAYER_PREFAB, _parentManager.GetParnetTrans(ParentName.PlayerRoot)); player.AddComponent <IgnorForce>(); player.AddComponent <PlayerCollider>(); IView view = player.AddComponent <PlayerView>(); IPlayerBehaviour behaviour = new PlayerBehaviour(player.transform, ModelManager.Single.PlayerData); IPlayerAni ani = null; IPlayerAudio audio = new PlayerAudio(player.GetComponentInChildren <AudioSource>()); Animator animator = player.GetComponent <Animator>(); if (animator == null) { Debug.LogError("玩家预制上为发现动画组件"); } else { ani = new PlayerAni(animator, new CustomAniEventManager(animator)); } var entity = Contexts.sharedInstance.game.CreateEntity(); entity.AddGamePlayer(view, behaviour, ani, audio); entity.AddGamePlayerAniState(PlayerAniIndex.IDLE); view.Init(Contexts.sharedInstance, entity); LoadTrails(player.transform, animator); }
void Start() { skillButton = GameObject.Find("TaiLungSpell1").GetComponent <SkillButton>(); Player = GameObject.FindWithTag("Player").GetComponent <Transform>(); anim = GameObject.FindWithTag("Player").GetComponent <Animator>(); player2 = GameObject.FindWithTag("RemotePlayer").GetComponent <Transform>(); playerFsm2 = GameObject.FindWithTag("Player").GetComponent <PlayerFSM2>(); attack = GameObject.Find("AttackButton").GetComponent <AttakButton>(); myAni = GameObject.FindWithTag("Player").GetComponent <PlayerAni>(); characterCreate = new CharacterCreate(); gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); //Player = GameObject.Find(myid).GetComponent<Transform>(); Debug.Log("JoyStick Scripts myid value: " + myid); // Player = GameObject.FindWithTag("Player").GetComponent<Transform>(); //EventTrigger eventTrigger = new EventTrigger(); Radius = GetComponent <RectTransform>().sizeDelta.y * 0.5f; StickFirstPos = Stick.transform.position; // 캔버스 크기에대한 반지름 조절. float Can = transform.parent.GetComponent <RectTransform>().localScale.x; Radius *= Can; MoveFlag = false; network = GameObject.Find("NetworkManager").GetComponent <Network>(); myid = network.myId; Debug.Log("네트워크 스크립트 내 아이디 : " + network.myId); remoteAni = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteAni>(); }
// Start is called before the first frame update private void Start() { PV = GetComponent <PhotonView>(); rb = GetComponent <Rigidbody>(); _Move = GetComponent <Move>(); _PlayerAni = GetComponent <PlayerAni>(); }
void Start() { remotePlayer = GameObject.FindWithTag("RemotePlayer").transform; myParams = GetComponent <RemoteParams>(); myAni = GetComponent <RemoteAni>(); myParams.InitParams(); myParams.deadEvent.AddListener(RemoteChangeToPlayerDead); player = GameObject.FindWithTag("Player").transform; playerParams = GameObject.FindWithTag("Player").GetComponent <PlayerParams>(); playerAni = GameObject.FindWithTag("Player").GetComponent <PlayerAni>(); monster = GameObject.Find("Spider").transform; redTowerPos = GameObject.FindWithTag("RedTower").transform; curEnemyParams = GameObject.Find("Monster").GetComponent <MonsterParams>(); towerParams = GameObject.FindWithTag("RedTower").GetComponent <TowerParams>(); network = GameObject.Find("NetworkManager").GetComponent <Network>(); Debug.Log("리모트 FSM Start "); skillBtn = GameObject.Find("TaiLungSpell1").GetComponent <SkillButton>(); }
// 초기화 void Start() { playerCharacter = GameObject.FindWithTag("Player"); player = GameObject.FindWithTag("Player").transform; myParams = GetComponent <PlayerParams>(); myAni = GetComponent <PlayerAni>(); myParams.InitParams(); myParams.deadEvent.AddListener(ChangeToPlayerDead); remotePlayer = GameObject.FindWithTag("RemotePlayer").transform; remoteParams = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteParams>(); remoteAni = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteAni>(); remoteFSM = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteFSM>(); monster = GameObject.Find("Spider").transform; skillButton = GameObject.Find("TaiLungSpell1").GetComponent <SkillButton>(); curEnemyParams = GameObject.Find("Monster").GetComponent <MonsterParams>(); basicAttack = GameObject.Find("AttackButton").GetComponent <AttakButton>(); redTowerPos = GameObject.FindWithTag("RedTower").transform; towerParams = GameObject.FindWithTag("RedTower").GetComponent <TowerParams>(); network = GameObject.Find("NetworkManager").GetComponent <Network>(); joy = GameObject.Find("JoystickBackGround").GetComponent <JoyStick>(); }
void Start() { skilM = GameManager.getInstance().m_cskillManager; ani = GetComponent <PlayerAni>(); myParams = GetComponent <PlayerParams>(); for (int i = 0; i < ShieldImageCoolTime.Count; i++) { if (myParams.m_CurrentJob == PlayerParams.Job.Warrior) { ShieldImageCoolTime[i] = UIManager.instance.m_ShieldImageCoolTime[i]; } if (myParams.m_CurrentJob == PlayerParams.Job.Wizard) { ShieldImageCoolTime[i] = UIManager.instance.m_ShieldImageCoolTime[i + 2]; } if (myParams.m_CurrentJob == PlayerParams.Job.Soldier) { ShieldImageCoolTime[i] = UIManager.instance.m_ShieldImageCoolTime[i + 4]; } } myParams.DeadEvent.AddListener(PlayerDead); //myParams.EnemyKillEvent.AddListener(CurrentEnemyDead); if (myParams.m_CurrentJob == PlayerParams.Job.Warrior) { attackDistance = 2.0f; } else { attackDistance = 6.0f; } ChangeState(State.Idle, PlayerAni.ANI_IDLE); StartCoroutine(UsedSkill()); }
void FirstFormatData() { firstGetData = false; // map = GameObject.Find("smallMapContainer").GetComponent <RectTransform>(); // skillManager = GetComponent <SkillBase>(); clickPointPos = GameObject.Find("clickPointPos"); nav = GetComponent <NavMeshAgent>(); deadManager = GetComponent <isDead>(); nav.updateRotation = false; MyCreatPoints = GetComponent <CreatPoints>(); myAudio = GetComponent <AudioSource>(); ani = GetComponent <Animator>(); AniControll = GetComponent <PlayerAni>(); if (photonView.isMine) { if (leftTopPowerBar == null) { leftTopPowerBar = GameObject.Find("mpBar_0020").GetComponent <Image>(); } myMainCamera = Camera.main; } originalData = PlayerData.instance.getPlayerData(meIs); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (ani == null) { ani = animator.gameObject.GetComponent <PlayerAni>(); } ani.comboCheck(0); }
private void Start() { m_Ani = GetComponent <PlayerAni>(); ChangeState(State.Idle, PlayerAni.Ani_Idle); p_Parameter = GetComponent <PlayerParameter>(); p_Parameter.InitParameter(); p_Parameter.DeadEvent.AddListener(ChangeToPlayerDead); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (playerScript == null || ani == null) { playerScript = animator.gameObject.GetComponent <Player>(); ani = animator.gameObject.GetComponent <PlayerAni>(); } playerScript.stopAnything_Switch(true); animator.SetBool(ani.aniHashValue[8], false); Debug.Log("進入"); }
// Use this for initialization void Start() { //Splats = GameObject.Find("SplatManager").GetComponent<SplatManager>(); myAni = GameObject.FindWithTag("Player").GetComponent <PlayerAni>(); playerFsm = GameObject.FindWithTag("Player").GetComponent <PlayerFSM2>(); playerAnimator = GameObject.FindWithTag("Player").GetComponent <Animator>(); joy = GameObject.Find("JoystickBackGround").GetComponent <JoyStick>(); network = GameObject.Find("NetworkManager").GetComponent <Network>(); Timer = 0f; }
private void Awake() { rb = GetComponent <Rigidbody>(); tr = GetComponent <Transform>(); PV = GetComponent <PhotonView>(); _PlayerAni = GetComponent <PlayerAni>(); scoreM = GameObject.Find("ScoreManager").GetComponent <ScoreManager>(); if (PV.IsMine) { NickName = PlayerPrefs.GetString("NickName"); } }
//public static void Main(string[] args) //{ public void Start() { //androidPlugin = GameObject.Find("NetworkManager").GetComponent<AndroidPlugin>(); Debug.Log("네트워크 스크립트"); //joy = GameObject.Find("JoystickBackGround").GetComponent<JoyStick>(); Debug.Log("네트워크 스크립트2"); singleton = this; player = GameObject.FindWithTag("Player").GetComponent <Transform>(); playerAni = GameObject.FindWithTag("Player").GetComponent <PlayerAni>(); player2 = GameObject.FindWithTag("RemotePlayer").GetComponent <Transform>(); remoteAni = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteAni>(); //rigidboby = GameObject.FindWithTag("RemotePlayer").GetComponent<Rigidbody>(); //myId = androidPlugin.text; //myId = "Nova"; //myTeam = "1"; //myId = "Nova"; //Debug.Log("내 아이디: "+ myId); //Connected(); //Send(myId + "," + "myTeamCall"); //ConnectToTcpServer(); //clientSocket.Close(); //myId = PlayerPrefs.GetString("myId"); exampleClass = GameObject.Find("IDManager").GetComponent <ExampleClass>(); myId = exampleClass.myId; Debug.Log("Unity Network Script myId: " + myId); //Connected(); //Send(myId); //ConnectToTcpServer(); playerFsm = GameObject.FindWithTag("RemotePlayer").GetComponent <PlayerFSM>(); playerFsm2 = GameObject.FindWithTag("Player").GetComponent <PlayerFSM2>(); remoteFSM = GameObject.FindWithTag("RemotePlayer").GetComponent <RemoteFSM>(); monsterFSM = GameObject.Find("Spider").GetComponent <MonsterFSM>(); Connected(); Send(myId); ConnectToTcpServer(); skillOne = GameObject.Find("TaiLungSpell1").GetComponent <SkillButton>(); //StartCoroutine(PlayerSet()); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (ani == null) { ani = animator.gameObject.GetComponent <PlayerAni>(); } if (player == null) { player = animator.gameObject.GetComponent <Player>(); } player.NowCC = false; player.deadManager.noCC = false; player.lockDodge = false; ani.GoBackIdle_canMove(); animator.SetBool(ani.aniHashValue[2], false); animator.SetInteger(ani.aniHashValue[3], 0); animator.SetBool(ani.aniHashValue[6], false); animator.SetBool(ani.aniHashValue[8], false); animator.SetBool(ani.aniHashValue[9], false); if (animator.GetBool(ani.aniHashValue[15])) { animator.SetBool(ani.aniHashValue[15], false); } }
private void Awake() { playerScript = GetComponent <Player>(); aniScript = GetComponent <PlayerAni>(); }
// Start is called before the first frame update void Start() { myAni = GetComponent <PlayerAni>(); ChangeState(State.Idle, PlayerAni.ANI_IDLE); }
private void Awake() { _instance = this; }