예제 #1
0
        // Todo: For the testing purpose, we should use the default character
        void InitCharacter()
        {
            if (isServer)
            {
                var p = Race.Create <Swordman> (swordmanPrefab);
                p.DefaultValue();
                p.playerNetId = netId.Value;
                p.GetModule <GoldModule> (x => {
                    x.AddGold(9999f);
                });
                p.GetModule <EnergyModule> (x => {
                    x.maxEnergy = 9999f;
                    x.AddEnergy(9999f);
                });
                p.GetModule <StatModule> (x => {
                    x.point = 9999;
                });
                p.transform.SetParent(transform);
                character = p;

                NetworkServer.SpawnWithClientAuthority(p.gameObject, gameObject);
            }
        }