コード例 #1
0
    protected override void DoActionIdle()
    {
        //m_tempTargeters = null;
        //Entity.State = EntityStateType.Idle;
        //m_timePassed = BattleRandom.Range(3f, 10f);

        AuxRecycleAllBulletLoopEffect();

        m_tempTargeters = null;
        Entity.State    = EntityStateType.Idle;
        m_timePassed    = BattleRandom.Range(0.5f, 1.5f);

#if UNITY_EDITOR
        BattleManager.logWaitTime.Add(GameRecord.Frame + ":timePassed:" + m_timePassed);
#endif  //  UNITY_EDITOR

        if (Entity.AimTarget)
        {
            //  背向地图中央
            var center = new Vector2(Constants.WIDTH / 2, Constants.HEIGHT / 2);
            var dir    = Entity.GetCurrentPositionCenter() - center;
            var angle  = MathUtil2D.GetAngleFromVector(IsoHelper.TileDirectionToScreenDirection(dir));

            Entity.PlayAnimationAtScreenAngle(AnimationNames.Stand, BattleRandom.Range(angle - 45, angle + 45));
        }
        else
        {
            Entity.PlayAnimation(AnimationNames.Stand);
        }
    }
コード例 #2
0
 public void PlayAnimationFaceToTile(string animationTypeName, TilePoint target, float fps = 0.0f)
 {
     view.PlayAnimation(animationNamePrefix + animationTypeName, GetDir5AndMirrorFlagFromDir8(GetDir8FromScreenAngle(MathUtil2D.GetAngleFromVector(IsoHelper.TileDirectionToScreenDirection(new Vector2(target.x - tilePos.x, target.y - tilePos.y))))), fps);
 }