// Use this for initialization void Start() { // physicsLogic = this.gameObject.GetComponent<PhysicsLogic> (); character = GameObject.Find("PlayerManager").GetComponent <Rigidbody2D>(); playerStatsLogic = this.gameObject.GetComponent <PlayerStatsLogic>(); animationLogic = this.gameObject.GetComponent <AnimationLogic>(); soundLogic = this.gameObject.GetComponent <SoundLogic>(); touch = GameObject.Find("TouchInterpter").GetComponent <TouchInterpeter>(); }
void Start() { physicsLogic = this.gameObject.GetComponent <PhysicsLogic> (); movmentLogic = this.gameObject.GetComponent <MovmentLogic> (); scoreLogic = this.gameObject.GetComponent <ScoreLogic>(); playerStatsLogic = this.gameObject.GetComponent <PlayerStatsLogic>(); missionLogic = this.gameObject.GetComponent <MissionLogic>(); animationLogic = this.gameObject.GetComponent <AnimationLogic>(); soundLogic = this.gameObject.GetComponent <SoundLogic>(); }
// Use this for initialization void Start() { //TODO: SET ASSETST // _BubblePowerUpIcon = Resources.Load("stupidL") as GameObject; missionLogic = this.gameObject.GetComponent <MissionLogic>(); playerStatsLogic = this.gameObject.GetComponent <PlayerStatsLogic>(); powerUPText = GameObject.Find("PowerUpText").GetComponent <Text>(); touch = GameObject.Find("TouchInterpter").GetComponent <TouchInterpeter>(); movmentLogic = this.gameObject.GetComponent <MovmentLogic>(); animationLogic = this.gameObject.GetComponent <AnimationLogic>(); character = GameObject.Find("PlayerManager"); _SuperhitPowerUpPrefab = Resources.Load("SuperHitPowerUp") as GameObject; BuildDictionary(); }
public void InitAnimation() { if (m_AnimLogic == null) { m_AnimLogic = gameObject.AddComponent <AnimationLogic>(); } if (null == m_AnimLogic) { return; } //首先保存该ObjAction的路径 m_AnimLogic.AnimResFilePath = m_AnimationFilePath; Transform modelTransform = gameObject.transform.FindChild("Model"); if (modelTransform) { m_ObjAnimation = modelTransform.gameObject.GetComponent <Animation>(); } if (m_ObjAnimation) { m_AnimLogic.InitState(m_ObjAnimation.gameObject); } else { LogModule.DebugLog("The Mount doesn't have animations. Moving her might look weird."); } if (m_FakeObjEffectController == null) { m_FakeObjEffectController = gameObject.AddComponent <FakeObjEffectBehaviourController>(); } if (m_FakeObjEffectController != null) { m_FakeObjEffectController.InitEffect(gameObject); } }
void Awake() { Instance = this; }
public override void OnBindOpt(Obj_Character obj) { base.OnBindOpt(obj); //婚车特殊摆设 if (BaseAttr.RoleBaseID == GlobeVar.PARADE_BUSID && obj != null) { Transform playermodel = obj.transform.FindChild("Model"); Transform ridepoint = gameObject.transform.FindChild("Model/All/Bip01/Bip01 Pelvis/Bip01 Spine/Ride_Point01"); Transform seatpoint = gameObject.transform.FindChild("Model/All/Bone02/Ride_Point02"); if (playermodel == null || ridepoint == null || seatpoint == null) { return; } if (GetBindChildIndex(obj.ServerID) == 0 && ridepoint.childCount < 1) { obj.gameObject.transform.localPosition = new Vector3(0.0f, 0.78f, -0.47f); GameObject fakeobj = (GameObject)Instantiate(playermodel.gameObject); if (fakeobj != null) { fakeobj.SetActive(true); fakeobj.transform.parent = ridepoint; fakeobj.transform.localPosition = Vector3.zero; fakeobj.transform.localRotation = Quaternion.Euler(90.0f, 0.0f, 0.0f); fakeobj.transform.localScale = Vector3.one; AnimationLogic al = ridepoint.gameObject.AddComponent <AnimationLogic>(); if (al != null) { al.InitState(fakeobj); Tab_RoleBaseAttr role = TableManager.GetRoleBaseAttrByID(obj.BaseAttr.RoleBaseID, 0); if (role != null) { Tab_CharModel mo = TableManager.GetCharModelByID(role.CharModelID, 0); if (mo != null) { al.AnimResFilePath = mo.AnimPath; } } // int animId = -1; //sl/ts/dl/xy //if (obj.BaseAttr.RoleBaseID == 0) // animId = 153; //else if (obj.BaseAttr.RoleBaseID == 1) // animId = 155; //else if (obj.BaseAttr.RoleBaseID == 2) // animId = 159; //else if (obj.BaseAttr.RoleBaseID == 3) // animId = 157; // if (animId > 0) { al.Play(227); } } } return; } if (GetBindChildIndex(obj.ServerID) == 1 && seatpoint.childCount < 1) { obj.gameObject.transform.localPosition = new Vector3(0.0f, 0.47f, -1.83f); GameObject fakeobj = (GameObject)Instantiate(playermodel.gameObject); if (fakeobj != null) { fakeobj.SetActive(true); fakeobj.transform.parent = seatpoint; fakeobj.transform.localPosition = Vector3.zero; fakeobj.transform.localRotation = Quaternion.Euler(90.0f, 0.0f, 0.0f); fakeobj.transform.localScale = Vector3.one; AnimationLogic al = seatpoint.gameObject.AddComponent <AnimationLogic>(); if (al != null) { al.InitState(fakeobj); Tab_RoleBaseAttr role = TableManager.GetRoleBaseAttrByID(obj.BaseAttr.RoleBaseID, 0); if (role != null) { Tab_CharModel mo = TableManager.GetCharModelByID(role.CharModelID, 0); if (mo != null) { al.AnimResFilePath = mo.AnimPath; } } //int animId = -1; ////sl/ts/dl/xy //if (obj.BaseAttr.RoleBaseID == 0) // animId = 146; //else if (obj.BaseAttr.RoleBaseID == 1) // animId = 148; //else if (obj.BaseAttr.RoleBaseID == 2) // animId = 152; //else if (obj.BaseAttr.RoleBaseID == 3) // animId = 150; //if (animId > 0) { al.Play(225); } } } return; } } }