using UnityEngine;
using System.Collections;
public class BasePlayerManager : MonoBehavior
{
public bool didInit;
// the user manager and AI controllers are publically accessible so
// that our individual control scripts can access them easily
public BaseUserManager DataManager;
// note that we initialize on Awake in this class so that it is
// ready for other classes to access our details when they
// initialize on Start
public virtual void Awake ()
{
didInit=false;
Init();
}
public virtual void Init ()
{ // cache ref to our user manager
DataManager= gameObject.GetComponent<BaseUserManager>();
if(DataManager==null)
DataManager= gameObject.AddComponent<BaseUserManager>();
// do play init things in this function
didInit= true;
}
public virtual void GameFinished()
{
DataManager.SetIsFinished(true);
}
public virtual void GameStart()
{
DataManager.SetIsFinished(false);
}
}
ilia1395
26.10.14 в 13:07