projectEli/Assets/NeoFPS/Core/SinglePlayer/Character/FpsSoloPlayerController.cs

38 lines
835 B
C#
Raw Normal View History

2022-11-07 01:28:33 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using UnityEngine.Events;
using NeoSaveGames.Serialization;
namespace NeoFPS.SinglePlayer
{
[HelpURL("https://docs.neofps.com/manual/fpcharactersref-mb-fpssoloplayercontroller.html")]
public class FpsSoloPlayerController : BaseController
{
public static FpsSoloPlayerController localPlayer
{
get;
private set;
}
public override bool isPlayer
{
get { return true; }
}
void Awake()
{
if (localPlayer == null)
localPlayer = this;
else
Destroy(gameObject);
}
void OnDestroy()
{
if (localPlayer == this)
localPlayer = null;
}
}
}