コード例 #1
0
    private void Awake()
    {
        if (instance)
        {
            Destroy(gameObject);
        }
        else
        {
            instance = this;
        }
        Physics2D.gravity = Vector2.zero;
        init = GetComponent <InitGameManager>();

        pistol             = new Pistol();
        rifts              = new Rifts();
        shotGun            = new ShotGun();
        sniper             = new Sniper();
        aug                = new AUG();
        dualBerretas       = new DualBerretas();
        knife              = new Knife();
        allWeaponsPossible = new List <Gun> {
            pistol,
            shotGun,
            rifts,
            sniper,
            aug,
            dualBerretas,
            knife
        };
        Quaternion quaternion = new Quaternion {
            eulerAngles = new Vector3(0, 0, 90)
        };

        playerTransform = Instantiate(playerPrefab, playerOriginPosition, quaternion);
        hc = playerTransform.GetComponent <HeroController>();
    }
コード例 #2
0
ファイル: ITagData.cs プロジェクト: guohong365/cmt
        public override XmlElement Export(XmlDocument doc, XmlElement parent)
        {
            XmlElement current = base.Export(doc, parent);

            if (ActiveFrom != null)
            {
                current.SetAttribute("ACTIVE_FROM", ActiveFrom.ToString());
            }
            if (ActiveTill != null)
            {
                current.SetAttribute("ACTIVE_TILL", ActiveTill.ToString());
            }
            if (Confcal != null)
            {
                current.SetAttribute("CONFCAL", Confcal.ToString());
            }
            if (Date != null)
            {
                current.SetAttribute("DATE", Date.ToString());
            }
            if (Days != null)
            {
                current.SetAttribute("DAYS", Days.ToString());
            }
            if (DaysAndOr != null)
            {
                current.SetAttribute("DAYS_AND_OR", DaysAndOr.ToString());
            }
            if (DaysCal != null)
            {
                current.SetAttribute("DAYSCAL", DaysCal.ToString());
            }
            if (Level != null)
            {
                current.SetAttribute("LEVEL", Level.ToString());
            }
            if (MaxWait != null)
            {
                current.SetAttribute("MAXWAIT", MaxWait.ToString());
            }
            if (Retro != null)
            {
                current.SetAttribute("RETRO", Retro.ToString());
            }
            if (Shift != null)
            {
                current.SetAttribute("SHIFT", Shift.ToString());
            }
            if (ShiftNum != null)
            {
                current.SetAttribute("SHIFTNUM", ShiftNum.ToString());
            }
            if (TagsActiveFrom != null)
            {
                current.SetAttribute("TAGS_ACTIVE_FROM", TagsActiveFrom.ToString());
            }
            if (TagsActiveTill != null)
            {
                current.SetAttribute("TAGS_ACTIVE_TILL", TagsActiveTill.ToString());
            }
            if (WeekDays != null)
            {
                current.SetAttribute("WEEKDAYS", WeekDays.ToString());
            }
            if (Weekscal != null)
            {
                current.SetAttribute("WEEKSCAL", Weekscal.ToString());
            }
            if (JAN != null)
            {
                current.SetAttribute("JAN", JAN.ToString());
            }
            if (FEB != null)
            {
                current.SetAttribute("FEB", FEB.ToString());
            }
            if (MAR != null)
            {
                current.SetAttribute("MAR", MAR.ToString());
            }
            if (APR != null)
            {
                current.SetAttribute("APR", APR.ToString());
            }
            if (MAY != null)
            {
                current.SetAttribute("MAY", MAY.ToString());
            }
            if (JUN != null)
            {
                current.SetAttribute("JUN", JUN.ToString());
            }
            if (JUL != null)
            {
                current.SetAttribute("JUL", JUL.ToString());
            }
            if (AUG != null)
            {
                current.SetAttribute("AUG", AUG.ToString());
            }
            if (SEP != null)
            {
                current.SetAttribute("SEP", SEP.ToString());
            }
            if (OCT != null)
            {
                current.SetAttribute("OCT", OCT.ToString());
            }
            if (NOV != null)
            {
                current.SetAttribute("NOV", NOV.ToString());
            }
            if (DEC != null)
            {
                current.SetAttribute("DEC", DEC.ToString());
            }
            return(current);
        }