コード例 #1
0
    /// <summary>
    /// 激活行为.
    /// </summary>
    public override void Active()
    {
        base.Active();
        if (hitAnim.Length > 0)
        {
            hero.DispatchEvent(ControllerCommand.CrossFadeAnimation, hitAnim);
        }
        isFinish             = false;
        action               = new ActionThrowUp(hero);
        action.beginPosition = hero.Position;
        action.endPosition   = KingSoftCommonFunction.NearPosition(hero.Position);
        KParams kParams = KConfigFileManager.GetInstance().GetParams();

        action.height        = kParams.HitHeight;
        action.changeForward = false;

        action.type      = ActionThrowUp.ThrowUpType.TIME;
        action.totalTime = time;
        action.Active();

        if (hero.property.isMainHero)
        {
            hero.DispatchEvent(ControllerCommand.HERO_MOVE);
        }
    }
コード例 #2
0
    /// <summary>
    /// 激活行为.
    /// </summary>
    public override void Active()
    {
        //FxAsset assert = new FxAsset();
        //assert.init(URLUtil.GetResourceLibPath() + buffInfor.BuffPath);

        base.Active();
        KParams kParams = KConfigFileManager.GetInstance().GetParams();

        outColor         = KingSoftCommonFunction.StringToColor(kParams.MonsterOutColor);
        totalTime        = kParams.MonsterOutTime;
        MonsterOutHeight = kParams.MonsterOutHeight;
        if (kParams.MonsterOutFx.Length > 0)
        {
            assert.init(URLUtil.GetResourceLibPath() + kParams.MonsterOutFx);
            GameObject fx = assert.CloneObj();
            if (null != fx)
            {
                fx.transform.position   = hero.Position;
                fx.transform.localScale = hero.transform.localScale * kParams.MonsterOutFxScale;
                DestoryObject d = fx.AddComponent <DestoryObject>();
                d.delta = 1f;
            }
        }
        hero.DispatchEvent(ControllerCommand.CrossFadeAnimation, "idle1", AMIN_MODEL.ONCE, false);
        isFinish = false;
        hero.DispatchEvent(ControllerCommand.CLEAR_BUFF);
        beginTime = Time.realtimeSinceStartup;
    }
コード例 #3
0
ファイル: ActionWalk.cs プロジェクト: moto2002/DinaGameClient
	/// <summary>
	/// 激活行为.
	/// </summary>
	public override void Active()
	{
		
		KParams kParams = KConfigFileManager.GetInstance().GetParams();
		commonSpeed = kParams.CommonSpeed;
		beginPosition = hero.Position;
		
		if(hero.Position.x == endPosition.x && hero.Position.z == endPosition.z)
		{
			action.FinishImmediate();
			isFinish = true;
			return;
		}
		else
		{
			action.beginPosition = beginPosition;
			action.endPosition = endPosition;
			action.speed = speed;
			action.isLock = isLock;
			action.deltaSpace = deltaSpace;
			action.distanceChangeFun = OnDistanceChangeFun;
			action.Active();
			endPosition = action.endPosition;
		}
		if (hero.property.isMainHero)
			hero.DispatchEvent(ControllerCommand.HERO_MOVE);
        hero.DispatchEvent(ControllerCommand.CrossFadeAnimation, hero.CharacterStateName(CharacterState.MOVE1), AMIN_MODEL.LOOP, true);
		
	}
コード例 #4
0
        public override void OnAttachToEntity(SceneEntity ety)
        {
            BaseInit(ety);
            redTicker.Stop();
            KParams kParams = KConfigFileManager.GetInstance().GetParams();

            redTicker.cd = kParams.HitColorTime;
            // 注册事件响应函数
            Regist(ControllerCommand.HIT_SLOW, OnBeHit);
        }
コード例 #5
0
        public override void OnAttachToEntity(SceneEntity ety)
        {
            BaseInit(ety);
            redTicker.Stop();
            KParams kParams = KConfigFileManager.GetInstance().GetParams();

            redTicker.cd = kParams.HitColorTime;

            hitColor = KingSoftCommonFunction.StringToColor(kParams.HitColor);

            // 注册事件响应函数
            Regist(ControllerCommand.BE_HIT, OnBeHit);
        }
コード例 #6
0
    // Update is called once per frame
    void LateUpdate()
    {
        if (null == SceneLogic.GetInstance().MainHero || null == SceneLogic.GetInstance().MainHero.property.target)
        {
            ClearSelecter();
            return;
        }

        KParams kParams = KConfigFileManager.GetInstance().GetParams();

        if (!SceneLogic.GetInstance().MainHero.property.AutoAttack)
        {
            float distance = KingSoftMath.CheckDistanceXZ(SceneLogic.GetInstance().MainHero.property.target.Position, SceneLogic.GetInstance().MainHero.Position);
            if (distance > kParams.MaxEnemyDistance)
            {
                SceneLogic.GetInstance().MainHero.property.target = null;
                ClearSelecter();
                return;
            }
        }
        if (SceneLogic.GetInstance().MainHero.property.target.HeroType == KHeroObjectType.hotPlayer)
        {
            if (null != GlowComponent.globalPlayerSelectGameObject)
            {
                float _scale = SceneLogic.GetInstance().MainHero.property.target.heroSetting.Scale;
                GlowComponent.globalPlayerSelectGameObject.transform.localScale = new Vector3(_scale, _scale, _scale);
                ParticleSystemScaleManager.instance.Scale(_scale, GlowComponent.globalPlayerSelectGameObject);
                GlowComponent.globalPlayerSelectGameObject.SetActive(true);
                GlowComponent.globalPlayerSelectGameObject.transform.position = SceneLogic.GetInstance().MainHero.property.target.transform.position + delta;
            }
            if (null != GlowComponent.globalSelectGameObject)
            {
                GlowComponent.globalSelectGameObject.SetActive(false);
            }
        }
        else
        {
            if (null != GlowComponent.globalPlayerSelectGameObject)
            {
                GlowComponent.globalPlayerSelectGameObject.SetActive(false);
            }
            if (null != GlowComponent.globalSelectGameObject && null != SceneLogic.GetInstance().MainHero.property.target.heroSetting)
            {
                float _scale = SceneLogic.GetInstance().MainHero.property.target.heroSetting.Scale;
                GlowComponent.globalSelectGameObject.transform.localScale = new Vector3(_scale, _scale, _scale);
                ParticleSystemScaleManager.instance.Scale(_scale, GlowComponent.globalSelectGameObject);
                GlowComponent.globalSelectGameObject.SetActive(true);
                GlowComponent.globalSelectGameObject.transform.position = SceneLogic.GetInstance().MainHero.property.target.transform.position + delta;
            }
        }
    }