Example #1
0
    public static FollowAction  getSSAction(GameObject player)
    {
        FollowAction action = CreateInstance <FollowAction>();

        action.player = player;
        return(action);
    }
    public void Awake()
    {
        //Debug.Log("CharacterState.Awake()");
        //Debug.Log("-- " + gameObject.name);

        statusListeners = new ArrayList();
        state = new PersistentCharacterState();

        item = null;
        followerAction = null;
        oneLinerTarget = null;
        currentSeat = null;
        lastPCDialogueEndedInSeconds = - 100.0f;
        state.lastSoberingMinute = 0;
        state.nightsSlept = 0;
        state.name = name;
        state.money = money;
        state.drunkness = 0.0f;
        state.justHadSex = false;
        state.startedBlindDate = false;
        state.variableSet = null;
        blindDateStartingTime = new DateTime(1, 1, 1);
        blindDateLength = new TimeSpan(0, 0, 0);
        currentTask = new TaskInfo(Task.NONE, null);
    }
    protected override void CopyTo(Action _destWarper)
    {
        FollowAction followAction = _destWarper as FollowAction;

        followAction.PilotTransform = PilotTransform;
        followAction.SetPosition    = SetPosition;
        followAction.SetRotation    = SetRotation;
        followAction.UseVelAsFacing = UseVelAsFacing;
        followAction.IgnoreVelY     = IgnoreVelY;
        base.CopyTo(_destWarper);
    }
Example #4
0
 public void SSActoinEvent(SSAction source, int param = 0, GameObject objParam = null)
 {
     if (param == 0)
     {
         FollowAction followAction = FollowAction.getSSAction(objParam.gameObject.GetComponent <PatrolData>().player);
         this.RunAction(objParam, followAction, this);
     }
     else
     {
         PatrolAction patrolAction = PatrolAction.getSSAction(objParam.gameObject.GetComponent <PatrolData>().start_position);
         this.RunAction(objParam, patrolAction, this);
         Singleton <GameEventManager> .Instance.playerEscape();
     }
 }
        protected override void setup()
        {
            if (RailPrefab == null)
            {
                throw new ArgumentNullException("RailPrefrab", "No rail prefab set");
            }
            railObject = UnityEngine.Object.Instantiate(RailPrefab, RailPosition, Quaternion.Euler(RailRotation));
            rail       = railObject.GetComponent <SmoothBezierCurve>();
            pilot      = new GameObject("Flyover").transform;
            pilot.SetParent(railObject.transform);
            CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>();
            GameObject             gameObject             = cPDataEntityCollection.GetComponent <GameObjectReferenceData>(cPDataEntityCollection.LocalPlayerHandle).GameObject;
            FollowAction           followAction           = gameObject.AddComponent <FollowAction>();

            followAction.PilotTransform = pilot;
            followAction.SetRotation    = false;
            followAction.UseVelAsFacing = true;
            followAction.enabled        = true;
        }
Example #6
0
    private void Start()
    {
        fsm         = new FSM("Cub AI");
        FleeState   = fsm.AddState("FleeState");
        FollowState = fsm.AddState("FollowState");

        FleeAction   = new FleeAction(FleeState);
        FollowAction = new FollowAction(FollowState);

        FollowState.AddAction(FollowAction);
        FleeState.AddAction(FleeAction);

        FollowState.AddTransition("ToFlee", FleeState);
        FleeState.AddTransition("ToFollow", FollowState);

        FollowAction.Init(this.transform, .1f, gameObject);
        FleeAction.Init(this.transform, .1f, gameObject);

        fsm.Start("FollowState");
    }
Example #7
0
 public AttackAction(IslandElement other)
 {
     this.other       = other;
     ifNotCloseEnough = new FollowAction(other, 0f);
     attackTime       = 0f;
 }
 protected override Action[] CreateActions()
 {
     Action[] actions = new Action[1];
     actions[0] = new FollowAction(actor, CharacterManager.GetPC(), reason, false);
     return actions;
 }
 public FollowConsequenceNode(GameObject actor, FollowAction.Reason reason)
     : base(actor, true)
 {
     this.reason = reason;
 }
 public void SetFollowerAction(FollowAction followerAction)
 {
     if (this.followerAction != null){
         this.followerAction.Replaced();
     }
     this.followerAction = followerAction;
 }