示例#1
0
        protected static void ProcessRemoteTargeting(Message m)
        {
            Block       block  = (Block)m.GetData(0);
            Vector3     pos    = (Vector3)m.GetData(1);
            Poultryizer script = block.GameObject.GetComponent <Poultryizer>();

            script.ProcessRemoteTargeting(pos);
        }
示例#2
0
 public override void OnPrefabCreation()
 {
     Chicken     = ChickenReferences.Locate();
     polymorpher = gameObject.AddComponent <Polymorpher>();
     polymorpher.Setup(this, Chicken);
     AddFire();
     Poultryizer.SetupNetworking();
     Polymorpher.SetupNetworking();
 }
示例#3
0
        public static void ProcessRemotePolymorphing(Message m)
        {
            Block  b      = (Block)m.GetData(0);
            Entity e      = (Entity)m.GetData(1);
            bool   heated = (bool)m.GetData(2);

            Poultryizer script = b.GameObject.GetComponent <Poultryizer>();

            script.polymorpher.ProcessRemotePolymorphing(e, heated);
        }
示例#4
0
        public void Setup(Poultryizer p, Poultryizer.ChickenReferences c)
        {
            poultryizer = p;
            Chicken     = c;
            ModAudioClip a = ModResource.GetAudioClip("polymorph");

            if (a.Available)
            {
                audioSource               = gameObject.GetComponent <AudioSource>() ?? gameObject.AddComponent <AudioSource>();
                audioSource.volume        = 0.9f;
                audioSource.spatialBlend  = 0.99f;
                audioSource.reverbZoneMix = 1;
                audioSource.clip          = clip = a;
            }
        }
示例#5
0
 public void ProcessRemotePolymorphing(Entity e, bool heated)
 {
     poultryizer.targetTransform = e.GameObject.transform;
     poultryizer.target          = Poultryizer.GetAIScript(e.GameObject);
     if (poultryizer.target)
     {
         if (heated)
         {
             ReplaceWithGrilledChicken(poultryizer.target);
         }
         else
         {
             ReplaceWithChicken(poultryizer.target);
         }
         poultryizer.ResetTarget();
     }
 }