コード例 #1
0
        private void Awake()
        {
                        #if UltimateFPSIsPresent
            // Tag the GameObject as 'Player' if it is not already
            gameObject.tag = Tags.player;
            player         = GetComponent <Player>();

            // Assign the UFPS components, and report warnings if they are not present
            fpCamera             = GetComponentInChildren <vp_FPCamera>();
            fpController         = GetComponentInChildren <vp_FPController>();
            fpInput              = GetComponentInChildren <vp_FPInput>();
            fpPlayerEventHandler = GetComponentInChildren <vp_FPPlayerEventHandler>();
            simpleHUD            = GetComponentInChildren <vp_SimpleHUD>();
            simpleCrosshair      = GetComponentInChildren <vp_SimpleCrosshair>();
            _audioListener       = GetComponentInChildren <AudioListener>();

            if (fpController == null)
            {
                ACDebug.LogWarning("Cannot find UFPS script 'vp_FPController' anywhere on '" + gameObject.name + "'.");
            }
            if (fpInput == null)
            {
                ACDebug.LogWarning("Cannot find UFPS script 'vp_FPInput' anywhere on '" + gameObject.name + "'.");
            }
            if (fpCamera == null)
            {
                ACDebug.LogWarning("Cannot find UFPS script 'vp_FPCamera' anywhere on '" + gameObject.name + "'.");
            }
            if (KickStarter.settingsManager != null && KickStarter.settingsManager.movementMethod != MovementMethod.FirstPerson)
            {
                ACDebug.Log("The Ultimate FPS integration script requires the Settings Manager's 'Movement method' is set to 'First Person'");
            }
                        #endif
        }
コード例 #2
0
 void Awake()
 {
     if (fpController == null)
     {
         fpController = GetComponentInChildren <vp_FPController>();
     }
     if (fpCamera == null)
     {
         fpCamera = GetComponentInChildren <vp_FPCamera>();
     }
     if (fpPlayerEventHandler == null)
     {
         fpPlayerEventHandler = GetComponentInChildren <vp_FPPlayerEventHandler>();
     }
     if (fpInput == null)
     {
         fpInput = GetComponentInChildren <vp_FPInput>();
     }
     if (fpHUD == null)
     {
         fpHUD = GetComponentInChildren <vp_SimpleHUD>();
     }
     if (fpCrosshair == null)
     {
         fpCrosshair = GetComponentInChildren <vp_SimpleCrosshair>();
     }
 }
コード例 #3
0
		void Awake() {
			if (fpController == null) fpController = GetComponentInChildren<vp_FPController>();
			if (fpCamera == null) fpCamera = GetComponentInChildren<vp_FPCamera>();
			if (fpPlayerEventHandler == null) fpPlayerEventHandler = GetComponentInChildren<vp_FPPlayerEventHandler>();
			if (fpInput == null) fpInput = GetComponentInChildren<vp_FPInput>();
			if (fpHUD == null) fpHUD = GetComponentInChildren<vp_SimpleHUD>();
			if (fpCrosshair == null) fpCrosshair = GetComponentInChildren<vp_SimpleCrosshair>();
		}
コード例 #4
0
ファイル: NetworkEvents.cs プロジェクト: volkanb/Vampire
    void Start()
    {
        // INITIALIZING NETW STATESYNC COMPONENT
        netwStateSync = gameObject.GetComponent<NetworkStateSync>();

        // VAMPIRE AND SLAYER BASE POSITIONS INITIALIZE
        VampireBasePos = GameObject.Find ("VampireBase").transform.position;
        SlayerBasePos = GameObject.Find ("SlayerBase").transform.position;

        // HUD INITIALIZATION
        HUD = gameObject.GetComponent<vp_SimpleHUD> ();
    }