Example #1
0
        public WorldScript Spawn(PlunderBody body)
        {
            var world = Instantiate(GameResources.Worlds[Mathf.Abs(body.ID.GetHashCode() % GameResources.Worlds.Count)]);

            world.Body = body;
            return(world);
        }
Example #2
0
        public PlunderScript Spawn(PlunderBody body)
        {
            var plunder = Instantiate(this);

            plunder.Body           = body;
            plunder.ID             = body.ID;
            plunder.LightingScript = LightingScript.Spawn(body);
            plunder.WorldScript    = WorldScript.Spawn(body);
            plunder.WorldScript.transform.SetParent(plunder.transform);
            plunder.LightingScript.transform.SetParent(plunder.WorldScript.transform);
            return(plunder);
        }
        public LightingScript Spawn(PlunderBody body)
        {
            var lighting = Instantiate(this);

            if (body.Plunder.IsPlunder)
            {
                lighting.PlunderLighting.SetActive(true);
            }
            else
            {
                lighting.NormalLighting.SetActive(true);
            }
            return(lighting);
        }