Example #1
0
    // Load the cat from a previous save
    public void Load()
    {
        // Load personality, stats and style
        personality  = CatPersonality.Load();
        stats        = CatStats.Load();
        style        = CatStyle.Load();
        achievements = CatAchievements.Load();

        // Load cat pose
        Quaternion r = new Quaternion(PlayerPrefs.GetFloat("pose.r.x"),
                                      PlayerPrefs.GetFloat("pose.r.y"),
                                      PlayerPrefs.GetFloat("pose.r.z"),
                                      PlayerPrefs.GetFloat("pose.r.w"));
        Vector3 p = new Vector3(PlayerPrefs.GetFloat("pose.p.x"),
                                PlayerPrefs.GetFloat("pose.p.y"),
                                PlayerPrefs.GetFloat("pose.p.z"));

        gameObject.transform.SetPositionAndRotation(p, r);
        // TODO: color, other info

        Debug.Log("--- LOADED --");
        Debug.Log(personality);
        Debug.Log(stats);
        Debug.Log(style);
        Debug.Log("-------------");
    }
Example #2
0
 // Called when there is no save to generate a new random cat
 public void CreateNew()
 {
     // Initialize stats for a completely content cat
     stats = new CatStats();
     // Initialize personality to random values
     personality = CatPersonality.RandomPersonality();
     // Initialize the style to random color
     style = CatStyle.RandomStyle();
     // Initialize no achievements
     achievements = new CatAchievements();
 }
Example #3
0
    public Context(GameObject _parentCat, ref CatPersonality _personality, ref CatStats _stats, ref CatActivity _activity)
    {
        parentCat   = _parentCat;
        personality = _personality;
        stats       = _stats;
        activity    = _activity;

        //Debug.Log("In Context constructor: ");
        //Debug.Log(personality);
        //Debug.Log(stats);
        //Debug.Log(activity);
        //Debug.Log("Exiting Context constructor.");
    }