void Start() { m_playerRB = GetComponent <Rigidbody>(); m_playerMovement = GetComponent <PlayerMovement>(); m_anim = GetComponentInChildren <AnimControl>(); m_nearbyObjects = new List <KeyValuePair <GameObject, PickableObject> >(); }
//-------------------------------------------------------------------------------------------------------- protected void onPlaying(AnimControl control, int frame, bool isPlaying) { if (mControl.getCurFrameIndex() >= mTextureNameList.Count) { return; } setSpriteName(mTextureNameList[mControl.getCurFrameIndex()], mUseTextureSize); // 使用位置列表进行校正 if (mEffectAlign == EFFECT_ALIGN.POSITION_LIST) { if (mTexturePosList != null && mTexturePosList.Count > 0) { int positionIndex = (int)(frame / (float)mTextureNameList.Count * mTexturePosList.Count + 0.5f); setPosition(mTexturePosList[positionIndex]); } } // 对齐父节点的底部 else if (mEffectAlign == EFFECT_ALIGN.PARENT_BOTTOM) { myUIObject parent = getParent(); if (parent != null) { Vector2 windowSize = getWindowSize(); Vector2 parentSize = parent.getWindowSize(); setPosition(replaceY(getPosition(), (windowSize.y - parentSize.y) * 0.5f)); } } int count = mPlayingCallbackList.Count; for (int i = 0; i < count; ++i) { mPlayingCallbackList[i](this, false); } }
// Use this for initialization void Awake() { Screen.lockCursor = true; charMotor = this.GetComponent <CharacterController>(); camTrans = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Transform>(); myAnim = this.GetComponent <AnimControl>(); }
// Use this for initialization void Start() { playerRB = GetComponent <Rigidbody>(); cam = Camera.main; savedMoveVector = Vector3.zero; anim = GetComponent <AnimControl>(); }
void Start() { m_stun = GetComponent <FightStun>(); m_rb = GetComponent <Rigidbody>(); audioSource = GetComponent <AudioSource>(); m_anim = GetComponentInChildren <AnimControl>(); }
// Use this for initialization void Awake() { // fireTrans = this.transform.FindChild("FirePoint").GetComponent<Transform>(); myAnim = this.GetComponent <AnimControl>(); myTrans = this.transform; StartCoroutine(BulletFire()); }
public txNGUITextureAnim() { mTextureNameList = new List <Texture>(); mControl = new AnimControl(); mUseTextureSize = false; mPlayEndCallback = new List <TextureAnimCallBack>(); mPlayingCallback = new List <TextureAnimCallBack>(); }
public txNGUISpriteAnim() { mType = UI_TYPE.UT_NGUI_SPRITE_ANIM; mControl = new AnimControl(); mTextureNameList = new List <string>(); mPlayEndCallback = new List <TextureAnimCallBack>(); mPlayingCallback = new List <TextureAnimCallBack>(); }
// Use this for initialization void Start() { nav = GetComponent <NavMeshAgent>(); AC = GetComponent <AnimControl>(); AS = GetComponent <AudioSource>(); GBM = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameBooleanManager>(); GSM = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameSceneManager>(); }
public txUGUIImageAnim() { mControl = new AnimControl(); mTextureNameList = new List <string>(); mPlayEndCallback = new List <TextureAnimCallBack>(); mPlayingCallback = new List <TextureAnimCallBack>(); mUseTextureSize = false; mEffectAlign = EFFECT_ALIGN.NONE; }
public txNGUISpriteAnim() { mControl = new AnimControl(); mTextureNameList = new List <string>(); mPlayEndCallback = new List <TextureAnimCallBack>(); mPlayingCallback = new List <TextureAnimCallBack>(); mMakeEvenSize = false; mUseTextureSize = false; }
public txNGUITextureAnim() { mType = UI_TYPE.UT_NGUI_TEXTURE_ANIM; mTextureNameList = new List <Texture>(); mControl = new AnimControl(); mUseTextureSize = false; mPlayEndCallback = new List <TextureAnimCallBack>(); mPlayingCallback = new List <TextureAnimCallBack>(); }
public txNGUISpriteAnim() { mControl = new AnimControl(); mTextureNameList = new List <string>(); mPlayEndCallback = new List <TextureAnimCallBack>(); mPlayingCallback = new List <TextureAnimCallBack>(); mTempSpriteDataList = new Dictionary <string, UISpriteData>(); mUseTextureSize = false; }
public txUGUIRawImageAnim() { mTextureNameList = new List <Texture>(); mControl = new AnimControl(); mUseTextureSize = false; mPlayEndCallback = new List <TextureAnimCallBack>(); mPlayingCallback = new List <TextureAnimCallBack>(); mTextureSetName = EMPTY_STRING; mSubPath = EMPTY_STRING; }
virtual protected void Awake() { _tf = transform; _content = _tf.Find("content"); _sprite = _tf.Find("content/sprite").GetComponent <SpriteRenderer>(); if (_sprite != null) { _sprite.sortingLayerName = Layers.Sorting.SYMBOL; } _anim = GetComponentInChildren <AnimControl>(); }
public myUGUIRawImageAnim() { mTextureNameList = new List <Texture>(); mControl = new AnimControl(); mUseTextureSize = false; mPlayEndCallback = new List <TextureAnimCallBack>(); mPlayingCallback = new List <TextureAnimCallBack>(); mTextureSetName = EMPTY; mSubPath = EMPTY; mThisPlayEnd = onPlayEnd; mThisPlaying = onPlaying; mEnable = true; }
protected override void OnStart() { //To be used on model's gloves? /* * m_startColor = GetComponent<MeshRenderer>().material.color; * m_renderer = GetComponent<MeshRenderer>(); */ audioSource = GetComponent <AudioSource>(); m_anim = transform.parent.GetComponentInChildren <AnimControl>(); }
public void Start() { Transform parent = transform.parent; if (parent) { m_player = parent.gameObject.GetComponent <Rigidbody>(); var fireballIndicatior = Instantiate(_FireballIndicatorPrefab); m_indicator = fireballIndicatior.GetComponent <FireballEmberIndicator>(); m_indicator.SetPlayer(m_player.gameObject); } m_anim = transform?.parent?.GetComponentInChildren <AnimControl>(); }
IEnumerator Attack1() { AnimControl.SetTrigger("Attack1"); yield return(new WaitForSeconds(1f * currentSpeedMultiplier())); if (Mathf.Abs(Vector3.Distance(transform.position, NearestPlayerPosition())) <= (attackRadius * 0.5)) { Iuna.GetComponent <IunaController>().SendMessage("TakeDamage", 1f); } yield return(new WaitForSeconds(waitUntilNextAttack)); Busy = false; }
protected override void Update() { base.Update(); if (!pauseControl.Paused) { StartCoroutine(Move(Input.GetAxisRaw("Horizontal") * Velocity * Time.deltaTime, Input.GetAxisRaw("Vertical") * Velocity * Time.deltaTime)); if (Input.GetButton("Fire1") && CanShoot) { CanShoot = false; AnimControl.SetTrigger("Attack"); Invoke("Attack", 1.0f); } } }
// Use this for initialization void Start() { if (!areaToStayIn) { enabled = false; return; } areaCollider = areaToStayIn.GetComponent <BoxCollider>(); penguinRB = GetComponent <Rigidbody>(); newPosition = Vector3.zero; areaPosition = areaToStayIn.transform.position; areaBound = areaCollider.bounds.extents; anim = GetComponent <AnimControl>(); StartCoroutine(resetPosition()); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); MUM = GetComponent <MainUIManagerSC>(); GSM = GetComponent <GameSceneManager>(); GBM = GetComponent <GameBooleanManager>(); PM = GetComponent <PortalManagerSC>(); AC = player.GetComponent <AnimControl>(); XN_Enegy = GameDataConfig.XN_MaxEnegy; DDH_Enegy = GameDataConfig.DDH_MaxEnegy; JSH_Enegy = GameDataConfig.JSH_MaxEnegy; CSJ_Enegy = GameDataConfig.CSJ_MaxEnegy; cam = Camera.main.GetComponent <Camera>(); GSM.CharState = "RHINOCEROS"; UpdataSkillButton("RHINOCEROS"); }
//--------------------------------------------------------------------------------------------------------------------------------------------------- protected void onPlaying(AnimControl control, int frame, bool isPlaying) { if (mControl.getCurFrameIndex() >= mTextureNameList.Count) { return; } setTexture(mTextureNameList[mControl.getCurFrameIndex()], mUseTextureSize); if (mTexturePosList != null) { int positionIndex = (int)(frame / (float)mTextureNameList.Count * mTexturePosList.Count + 0.5f); setPosition(mTexturePosList[positionIndex]); } foreach (var item in mPlayingCallback) { item(this, false); } }
protected override void Update() { base.Update(); AnimControl.SetFloat("Multiplier", (1f + currentSpeedMultiplier())); if (!Busy) { if (Mathf.Abs(Vector3.Distance(transform.position, NearestPlayerPosition())) > 1f) { StartCoroutine(MoveTowards(NearestPlayerPosition())); } else { Busy = true; StartCoroutine(Attack1()); } } }
protected void onPlayEnd(AnimControl control, bool callback, bool isBreak) { // 正常播放完毕后根据是否重置下标来判断是否自动隐藏 if (!isBreak && mControl.getAutoResetIndex()) { setActive(false); } List <TextureAnimCallBack> temp = new List <TextureAnimCallBack>(mPlayEndCallback); mPlayEndCallback.Clear(); if (temp.Count > 0 && callback) { foreach (var item in temp) { item(this, isBreak); } } }
//--------------------------------------------------------------------------------------------------------------------------------------------------- protected void onPlaying(AnimControl control, int frame, bool isPlaying) { if (mControl.getCurFrameIndex() >= mTextureNameList.Count) { return; } setTexture(mTextureNameList[mControl.getCurFrameIndex()], mUseTextureSize); if (mTexturePosList != null) { int positionIndex = (int)(frame / (float)mTextureNameList.Count * mTexturePosList.Count + 0.5f); setPosition(mTexturePosList[positionIndex]); } int count = mPlayingCallback.Count; for (int i = 0; i < count; ++i) { mPlayingCallback[i](this, false); } }
protected void onPlayEnd(AnimControl control, bool callback, bool isBreak) { // 正常播放完毕后根据是否重置下标来判断是否自动隐藏 if (!isBreak && mControl.isAutoResetIndex()) { setActive(false); } if (callback) { List <TextureAnimCallBack> tempList = mListPool.newList(out tempList); tempList.AddRange(mPlayEndCallback); mPlayEndCallback.Clear(); foreach (var item in tempList) { item(this, isBreak); } mListPool.destroyList(tempList); } else { mPlayEndCallback.Clear(); } }
protected void onPlayEnd(AnimControl control, bool callback, bool isBreak) { // 正常播放完毕后根据是否重置下标来判断是否自动隐藏 if (!isBreak && mControl.isAutoResetIndex()) { setActive(false); } if (callback) { LIST(out List <TextureAnimCallBack> tempList); tempList.AddRange(mPlayEndCallback); mPlayEndCallback.Clear(); int count = tempList.Count; for (int i = 0; i < count; ++i) { tempList[i](this, isBreak); } UN_LIST(tempList); } else { mPlayEndCallback.Clear(); } }
// Use this for initialization void Start() { gravity = 20; jumpSpeed = 10.0f; heart = false; speed = 2; health = 100; rate = 0; indicator = 1; rateMul = 1; alive = true; controller = GetComponent<CharacterController>(); anim = GameObject.FindGameObjectWithTag("Fatty").GetComponent<AnimControl>(); score = GetComponent<Score>(); maxSpeed = 6; coEffect = GetComponent<CollideEffects>(); sounds = GetComponent<Sounds>(); isJumping = false; damageDelay = 0; startPoint = transform.position.x; footsound = speed / speedAnimRatio; }
// Use this for initialization void Start() { penguinScript = transform.parent.GetComponent <AnimControl>(); }