コード例 #1
0
    public FollowState(GameObject leader, Ship leaderController,
                       float maxVelocity, NpcType typeToDetect)
    {
        this.leader           = leader;
        this.leaderController = leaderController;
        this.maxVelocity      = 30;
        this.typeToDetect     = typeToDetect;

        npcDetector = new NPCDetector();

        stateID = StateID.BotFollowStateID;
    }
コード例 #2
0
    public WanderState(GameObject npc, Vector3 velocity, NpcType typeToDetect, float detectrange,
                       Transform gunTipPosition)
    {
        this.velocity       = npc.transform.forward * MaxSpeed;
        this.startPosition  = npc.transform.position;
        this.detectrange    = detectrange;
        this.typeToDetect   = typeToDetect;
        this.gunTipPosition = gunTipPosition;

        npcDetector = new NPCDetector();
        randomAngle = Random.rotation;

        stateID = StateID.EnemyWanderStateID;
    }