Ejemplo n.º 1
0
 private void SetupScene()
 {
     gameAvatar = FetchAvatarInScene();
     if (gameAvatar == null)
     {
         gameAvatar = SpawnAvatar();
     }
 }
Ejemplo n.º 2
0
 public ControllableSprite SpawnAvatar(Vector3 position, Quaternion rotation)
 {
     if (gameAvatar != null)
     {
         Debug.LogWarning("_GameManager[" + name + "]/SpawnAvatar (Vector3, Quaternion) : Spawning avatar, but one already exists.");
     }
     gameAvatar = (ControllableSprite)Instantiate(prefab_gameAvatar, position, rotation);
     return(gameAvatar);
 }
    void Awake()
    {
        controllableSprite = GetComponent <ControllableSprite> ();

        if (controllableSprite == null)
        {
            Debug.LogWarning("Controllable sprite wasn't found on gameobject. Disabling script.");
            enabled = false;
        }

        if (animationInterface == null)
        {
            Debug.LogWarning("SpriteAnimationHandler[" + name + "]/Awake (): Animator controller wasn't assigned. Disabling script.");
            enabled = false;
        }
    }