Exemplo n.º 1
0
    public static void InitializeFrom(Round2.BINADOOR door)
    {
        if (m_doorlist.ContainsKey(door._OSD.DoorId))
        {
            Round2.DOOR l_d = Round2.DOOR.m_doorClasses[door._OSD.Class];

            foreach (OBOA_Instantiator iinst in m_doorlist[door._OSD.DoorId])
            {
                SphereCollider sc = iinst.gameObject.AddComponent <SphereCollider>();
                sc.radius    = Mathf.Sqrt(door._OSD.SquaredActivationRadius) / 2f;
                sc.isTrigger = true;
                Animation l_a = iinst.GetComponentInChildren <Animation>();
                l_a.AddClip(l_d.Animation.OBAN.Clip(true), "door");

                iinst.m_onTriggerHit = () =>
                {
                    foreach (OBOA_Instantiator _iinst in m_doorlist[door._OSD.DoorId])
                    {
                        _iinst.GetComponentInChildren <Animation>().Play("door");
                    }
                };
            }
        }
        else
        {
            Debug.LogError("INVALID DOOR ID:" + door._OSD.DoorId);
        }
    }
Exemplo n.º 2
0
 static void UseDOOR(Oni.InstanceDescriptor ides)
 {
     Round2.DOOR des = DeserializeAs <Round2.DOOR>(ides.AsXmlStream());
     Debug.Log(des.id);
 }