public void setStateFrom(PlayerFollowerXYConfig other)
 {
     lookTarget = other.lookTarget;
     timeFactor = other.timeFactor;
     offsetY    = other.offsetY;
     smoothLerp = other.smoothLerp;
     lockY      = other.lockY;
 }
예제 #2
0
 void Awake()
 {
     camPosYCorrection = GetComponent <LockYWhenPlayerOnTarget>();
     xyConfig          = GetComponent <PlayerFollowerXYConfig>();
     // register against the GUICameraSync manager
     Camera.main.GetComponent <GUICameraSync>().register(this);
     // cache the player
     player  = LevelManager.Instance.getPlayer();
     applied = false;
 }
예제 #3
0
 // Use this for initialization
 void Awake()
 {
     lookUpAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.LookUpwards, true);
     dirSign  = 0f;
     walk     = GetComponent <PlayerWalk>();
     // since we cannot create an instance from a MonoBehaviour then do next
     tempConfig = gameObject.AddComponent <PlayerFollowerXYConfig>();
     // disable the dummy component from being updated by Unity3D game loop
     tempConfig.enabled = false;
 }
    void Awake()
    {
        // since we cannot create an instance from a MonoBehaviour then do next
        tempConfig = gameObject.AddComponent <PlayerFollowerXYConfig>();
        // disable the dummy component from being updated by Unity3D game loop
        tempConfig.enabled = false;

        origFollower = GetComponent <PlayerFollowerXYConfig>();

        enabled  = false;
        restored = true;
    }
예제 #5
0
    public void init()
    {
        origFollower = GetComponent <PlayerFollowerXYConfig>();

        // copy current Main Camera configuration
        origSmoothLerp = origFollower.smoothLerp;

        // set new Main Camera's follower script configuration according to the effect we want to achieve
        origFollower.lockY      = false;    // follow the player
        origFollower.smoothLerp = false;    // instant movement along the player's movement

        // get player instance's transform
        player = LevelManager.Instance.getPlayer();

        enabled = true;
    }
 void OnDestroy()
 {
     origFollower = null;
 }
 void OnDestroy()
 {
     player       = null;
     origFollower = null;
 }
 void Awake()
 {
     origFollower = GetComponent <PlayerFollowerXYConfig>();
     this.enabled = false;
 }