示例#1
0
        public FollowState(CameraFSM controller, GameObject gameObject, bool eventBased) : base(controller)
        {
            objectToFollow     = gameObject;
            notifyEventManager = eventBased;

            print("Camera FollowState");
        }
示例#2
0
        public MoveState(CameraFSM controller, float xPosition, float yPosition, bool eventBased) : base(controller)
        {
            targetX            = xPosition;
            targetY            = yPosition;
            notifyEventManager = eventBased;

            print("Camera MoveState");
        }
示例#3
0
    void Awake()
    {
        config          = new CameraConfig(ConfigResourceLoader.inst.loadConfig("Config/camera.xml").ToXml());
        cam             = GetComponent <Camera>();
        cam.fieldOfView = config.defaultFOV;
        fsm             = new CameraFSM(this);
        fsm.changeState(GameState.Enter);

        LogicEvent.add("onBeginReplay", this, "onBeginReplay");
        if (WithoutEnterShow_4Test_EditorOnly.instance != null)
        {
            fsm.changeState(GameState.Gaming);
        }
        else
        {
            fsm.changeState(GameState.Enter);
        }
        LogicEvent.add("onGameReady", this, "onGameReady");
        LogicEvent.add("onGameOver", this, "onGameOver");
    }
示例#4
0
    // Awake is called before Start
    void Awake()
    {
        // Set up singleton
        if (!instance)
        {
            instance = this;
        }

        // Sets this to not be destroyed when loading different scene... Not sure it's needed for this game
        //DontDestroyOnLoad(gameObject);

        // Retrieve references for everything game manager cares about
        livingBeings    = GetComponentsInChildren <Living>();
        cameraFSM       = FindObjectOfType <Camera>().GetComponent <CameraFSM>();
        checkpoints     = FindObjectsOfType <Checkpoint>();
        stageController = FindObjectOfType <StageController>();
        gates           = FindObjectsOfType <Gate>();

        Puppet[] puppets = GetComponentsInChildren <Puppet>();
        playerPuppet   = puppets[0];
        daughterPuppet = puppets[1];
    }
示例#5
0
 public void SetCameraFSM(CameraFSM camera)
 {
     cameraFSM = camera;
 }
示例#6
0
 public CameraState(CameraFSM camera) : base()
 {
     cameraFSM = camera;
 }