コード例 #1
0
ファイル: CameraMec2.cs プロジェクト: Stibbins/hover
    void Start()
    {
        targetedPos = target.position;
        follow      = target.GetComponent <FollowLogic> ();
        //state = target.GetComponent<DetectState> ();
        height                 = groundHeight;
        distance               = m_DefaultDistance;
        oldWantedHeight        = 0;
        decidedDefaultDistance = m_DefaultDistance;
        jumpDistance           = decidedDefaultDistance + 5;

        defaultHeight = height;
    }
コード例 #2
0
    public int GetPetState()
    {
        PetState    petState    = (PetState)this.GetComponent(typeof(PetState));
        IdleLogic   idleLogic   = (IdleLogic)this.GetComponent(typeof(IdleLogic));
        FollowLogic followLogic = (FollowLogic)this.GetComponent(typeof(FollowLogic));
        WanderLogic wanderLogic = (WanderLogic)this.GetComponent(typeof(WanderLogic));
        int         result      = this.indexAction;

        this.useTimer = true;
        if (this.calledByPlayer != 0)
        {
            float num = Vector3.Distance(this.get_transform().get_position(), this.owner.get_transform().get_position());
            if (num <= this.ownerDist && RuntimeServices.ToBool(RuntimeServices.InvokeBinaryOperator("op_LessThan", RuntimeServices.GetProperty(RuntimeServices.GetProperty(this.owner.GetComponent(typeof(CharacterController)), "velocity"), "magnitude"), 1)))
            {
                result = 0;
            }
            else if (num > this.ownerDist)
            {
                result = 2;
            }
            this.useTimer = false;
        }
        else if (this.calledByPlayer == 0 && this.indexAction == 2)
        {
            result = Random.Range(0, 2);
        }
        else if (Time.get_time() - (float)this.stateStartTime > this.stateTimeOut)
        {
            int num2 = this.indexAction;
            if (num2 == 0)
            {
                result = 1;
            }
            else if (num2 == 1)
            {
                result = 0;
            }
            else
            {
                result = this.indexAction;
            }
        }
        return(result);
    }
コード例 #3
0
ファイル: CameraMec2.cs プロジェクト: Raful/Hoverboard
    void Start()
    {
        targetedPos = target.position;
        follow = target.GetComponent<FollowLogic> ();
        //state = target.GetComponent<DetectState> ();
        height = groundHeight;
        distance = m_DefaultDistance;
        oldWantedHeight = 0;
        decidedDefaultDistance = m_DefaultDistance;
        jumpDistance = decidedDefaultDistance + 5;

        defaultHeight = height;
    }