void Awake () { if (Instance == null) Instance = this; else Destroy(this); }
private void Start () { if (Instance == null) Instance = this; else Destroy(this); // if (cam == null) // cam = Camera.main.GetComponent<TestCam>(); simpleRpgCam = Camera.main.GetComponent<PhatRobit.SimpleRpgCamera>(); charState = GameObject.FindObjectOfType<RomanCharState> (); //camScript = GameObject.FindObjectOfType<RomanCameraController> (); climbDetector = GameObject.FindObjectOfType<ClimbDetector> (); follow = GameObject.FindObjectOfType<FollowPlayer>(); vineClimbCollider = GameObject.FindObjectOfType<VineClimbController2>(); charController = GameObject.FindObjectOfType<RomanCharController>(); tunnelObserver = GameObject.FindObjectOfType<TunnelObserver>(); antiWallSlideController = GameObject.FindObjectOfType<SloapDetector>(); //cam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<TestCam>(); // Get the character that is selected if (charController != null) currentChar = charController.transform; }
void Start () { if (GameManager.componentActivatorOn) { ComponentActivator.Instance.Register (this, new Dictionary<GameEvent, bool> { //{ GameEvent.Land, true }, { GameEvent.ClimbOverEdge, true }, { GameEvent.StopClimbing, true }, { GameEvent.FinishClimbOver, true }, //{ GameEvent.Land, true }, //{ GameEvent.LandedFirstTime, false }, { GameEvent.StartVineClimbing, false }, { GameEvent.StartEdgeClimbing, false }, { GameEvent.StartWallClimbing, false } }); } charState = GetComponent<RomanCharState>(); animator = GetComponent<Animator>(); rb = GetComponent<Rigidbody>(); cam = Camera.main.transform; cController = GetComponent<CharacterController>(); cCollider = GetComponent<CapsuleCollider>(); vineClimbCollider = GetComponent<VineClimbController2>(); tunnelObserver = GameManager.Instance.tunnelObserver; combatController = GetComponent<CombatController> (); }
// private Animator animator; void Start () { if (player != null) { // animator = player.GetComponent<Animator>(); charState = player.GetComponent<RomanCharState>(); tunnelObserver = GameManager.Instance.tunnelObserver; } else { Debug.LogError("FollowPlayer: Player is null"); } }