コード例 #1
0
ファイル: Locations.cs プロジェクト: tiredamage42/UnityTools
 void InitLocation(string scene, string name, Vector3 pos, float rot, LocationType type, Vector3 size, List <string> containedLocations)
 {
     this.scene = scene;
     this.name  = name;
     this.pos   = pos;
     this.type  = (int)type;
     this.size  = size;
     this.containedLocations = containedLocations;
     this.rot = rot;
 }
コード例 #2
0
        public SceneObjectState(Component c)
        {
            // get all saveable information from attached scripts,
            // maybe a scene item has an inventory or otehr ocmponents thhat need to save their states
            ISaveableAttachment[] saveables = c.GetComponents <ISaveableAttachment>();

            attachmentStates = new AttachmentState[saveables.Length];
            for (int x = 0; x < saveables.Length; x++)
            {
                attachmentStates[x] = new AttachmentState(saveables[x].AttachmentType(), saveables[x].OnSaved());
            }

            this.position = c.transform.position;
            this.rotation = c.transform.rotation;
        }