示例#1
0
    // 정보 갱신.
    public void InfoUpdate(float _Damage)
    {
        HP -= _Damage;

        if (HP <= 0)
        {
            // 폭발한다.
            explosion();

            HP   = 0;       // 체력의 수치가 음의 값으로 갔을 경우를 대비한 초기화.
            Life = false;   // 죽었음을 알림.

            if (this.gameObject.name == "Enemy")
            {
                PlayerManager.GetInstance().AddPlayerScore(100);
            }
            else if (this.gameObject.name == "Enemy2")
            {
                PlayerManager.GetInstance().AddPlayerScore(120);
            }
            // 내 죽음을 부모에리어에게 알려라!
            // 부모 에리어가 가진 스크립트를 가져와 DeadEnemy()함수를 호출.
            // transform.parent.GetComponent<CreateEnemy>().DeadEnemy();
            ObjManager.Call().DestroyEnemy();
            gameObject.SetActive(false);
        }
    }
示例#2
0
    // 소환!
    void ESummon()
    {
        if (zombieName == "Enemy")
        {
            for (int i = 0; i < MaxCount; i++)
            {
                GameObject obj = ObjManager.Call().GetObject("Enemy");      // Enemy객체 요청.
                obj.transform.position = RandomPos();                       // 위치 랜덤 설정.
                obj.transform.parent   = transform;                         // 부모 설정.
                obj.SetActive(true);                                        // 적 활성화.
                obj.GetComponent <Enemy>().Init();                          // 적 정보 초기화.
                EnemyCount++;
            }
        }
        if (zombieName == "Enemy2")
        {
            for (int i = 0; i < MaxCount; i++)
            {
                GameObject obj2 = ObjManager.Call().GetObject("Enemy2");     // Enemy객체 요청.
                obj2.transform.position = RandomPos();                       // 위치 랜덤 설정.
                obj2.transform.parent   = transform;                         // 부모 설정.
                obj2.SetActive(true);                                        // 적 활성화.
                obj2.GetComponent <Enemy>().Init();                          // 적 정보 초기화.
                EnemyCount++;
            }
        }

        Summon = true;
    }
    public void UpdateCamera(GameObject o)
    {
        if (o == null)
        {
            return;
        }
        var smrs = o.GetComponentsInChildren <SkinnedMeshRenderer>();

        if (smrs == null)
        {
            return;
        }
        var vList = new List <Vector3>();

        foreach (var smr in smrs)
        {
            vList.Add(smr.sharedMesh.bounds.max);
            vList.Add(smr.sharedMesh.bounds.min);
        }
        var bigBound = ObjManager.GetBoundsOfVector3Array(vList.ToArray());

        center = bigBound.center;
        var r = (bigBound.max - bigBound.min).magnitude / 2;

        transform.position = new Vector3(0, bigBound.center.y, 2 * r);
        transform.forward  = center - transform.position;
    }
示例#4
0
 private float timeLastClick;//最后一次被点击的时间
 // Use this for initialization
 void Awake()
 {
     objManager = GameObject.Find("ObjManager").GetComponent <ObjManager>();
     panelItemWarehouseController = objManager.panelItemWareHouseController;
     timeLastClick   = 0;
     objAbsolutePath = "";
 }
        public override async Task Process(Controller controller)
        {
            var sessionContainer = (NewSession)ObjManager.GetObject(data.sessionId);
            var transaction      = await sessionContainer.Session.BeginTransactionAsync(TransactionConfig);

            TransactionId = controller.TransactionManagager.AddTransaction(transaction);
        }
 private void Awake()
 {
     objManager            = GameObject.Find("ObjManager").GetComponent <ObjManager>();
     panelStatusController = objManager.panelStatusController;
     gameObject.layer      = Macro.MODEL3D_ITEM; //设置为model3dItem层
     gameObject.tag        = Macro.UNSELECTED;   //将tag设置为未选中
 }
示例#7
0
    void Start()
    {
        GoogleAdsManager.Instance.HideBanner();

        for (int i = 0; i < ScenarioData.Instance.ScenarioList.Count; i++)
        {
            GameObject item = ObjManager.SpawnPool("Illust", Vector3.zero, Quaternion.Euler(0, 0, 0));

            if (GameManager.Instance.ScenarioIllust[i])
            {
                item.transform.GetChild(1).GetComponent <Image>().sprite = Illusts[i];
            }
            else
            {
                item.transform.GetChild(1).GetComponent <Image>().sprite = Null;
            }
            item.transform.GetChild(0).GetComponent <Text>().text =
                ScenarioData.Instance.ScenarioList[i].Name;

            int j = i;
            item.transform.GetComponent <Button>().onClick.AddListener(() => Push_IllustBT(j));
        }
        Scroll.GetComponent <RectTransform>().sizeDelta =
            new Vector2(911.0076f, ScenarioData.Instance.ScenarioList.Count * 610 + 100);

        Popup_Black.SetActive(false);
        Popup_Illust.SetActive(false);

        //Bottom_Button.SetY(50 + Define.Math.DPToPixel(Screen.width * 16 / 9, GoogleAdsManager.Instance.GetBannerHeight()));
        //Bottom_Scroll.SetBottom(230 + Define.Math.DPToPixel(Screen.width * 16 / 9, GoogleAdsManager.Instance.GetBannerHeight()));
    }
示例#8
0
    // 폭발은 예술이다.
    void explosion()
    {
        string Name = "NoData";

        // 잔해물 소환.
        for (int i = 0; i < 4; i++)
        {
            // 잔해물 4종류.
            switch (i)
            {
            case 0: Name = "Cube";      break;

            case 1: Name = "Cylinder";  break;

            case 2: Name = "Capsule";   break;

            case 3: Name = "Sphere";    break;
            }

            // 잔해물을 4종류를 5개씩 총 20개를 생성 후 뿌린다.
            for (int j = 0; j < 5; j++)
            {
                GameObject obj = ObjManager.Call().GetObject(Name);

                if (obj == null)
                {
                    continue;
                }

                obj.transform.position = transform.position;
                obj.SetActive(true);
                obj.GetComponent <ExplosionHide>().StartCoroutine("StartExplosionHide");
            }
        }
    }
示例#9
0
        public override async Task Process(Controller controller)
        {
            Success = true;

            var sessionContainer = (NewSession)ObjManager.GetObject(data.sessionId);
            await sessionContainer.Session.ReadTransactionAsync(async tx =>
            {
                TransactionId = controller.TransactionManagager.AddTransaction(new TransactionWrapper(tx, async cursor =>
                {
                    var result = ProtocolObjectFactory.CreateObject <TransactionResult>();
                    await result.PopulateRecords(cursor).ConfigureAwait(false);
                    return(result.uniqueId);
                }));

                sessionContainer.SessionTransactions.Add(TransactionId);

                await controller.SendResponse(new ProtocolResponse("RetryableTry", TransactionId).Encode()).ConfigureAwait(false);

                try
                {
                    //Start another message processing loop to handle the retry mechanism.
                    await controller.ProcessStreamObjects().ConfigureAwait(false);
                }
                catch
                {
                    Success = false;
                }

                controller.TransactionManagager.RemoveTransaction(TransactionId);
            }, TransactionConfig);
        }
        public override async Task Process()
        {
            IAsyncSession session = ((NewSession)ObjManager.GetObject(data.sessionId)).Session;

            Bookmarks = session.LastBookmark.Values;
            await Task.CompletedTask;
        }
    private List <Bounds> MergeSameCenterBounds(List <Bounds> boundsList)
    {
        var re = new List <Bounds>();

        boundsList.Sort(new BoundsComparer());
        bool isFirst = true; //第一个是初始bounds不要生成接触点
        var  bounds  = new Bounds(new Vector3(-oo, -oo, -oo), new Vector3(0, 0, 0));
        int  cnt     = 0;    //接触点数量

        foreach (var item in boundsList)
        {
            //Debug.Log("center:"+item.center.x+ ","+item.center.y + "," + item.center.z);
            var tmp = item.center - bounds.center;
            if (Dcmp(tmp.x) == 0 && Dcmp(tmp.y) == 0 && Dcmp(tmp.z) == 0)
            {
                bounds.extents = ObjManager.GetMaxVector3(bounds.extents, item.extents);
            }
            else
            {
                if (!isFirst)
                {
                    re.Add(bounds);
                    cnt++;
                }
                isFirst = false;
                bounds  = item;
            }
        }
        if (!isFirst)
        {
            re.Add(bounds);
            cnt++;
        }
        return(re);
    }
示例#12
0
    // 총알 키 체크.
    void KeyCheck()
    {
        if (Input.GetButtonDown("Jump"))  //스페이스바로 총알 발사
        {
            if (realTimeBulletNumber == 1)
            {
                realTimeBulletNumber -= 1;
                currentBulletNumber.gameObject.GetComponent <Text>().text = (realTimeBulletNumber).ToString();
                StartCoroutine("NextFire");
                Invoke("reloadBullet", 3f);
            }
            else
            {
                realTimeBulletNumber -= 1;
                currentBulletNumber.gameObject.GetComponent <Text>().text = (realTimeBulletNumber).ToString();
                StartCoroutine("NextFire");
            }
        }
        else if (Input.GetButtonUp("Jump"))
        {
            ContinuouFire = false;
        }

        if (Input.GetKeyDown(KeyCode.Q))
        {
            ObjManager.Call().MemoryDelete();
        }

        //   if (Input.GetKeyDown(KeyCode.E))
        //       ObjManager.Call().CreateObject("Bullet", 20);
    }
示例#13
0
 void Awake()
 {
     objManager             = GameObject.Find("ObjManager").GetComponent <ObjManager>();
     imageDrawMapController = objManager.imageDrawMapController;
     UpdateButtonIfActive();
     UpdateButtonAreaId();
 }
示例#14
0
 public void buyClick()
 {
     if (GunMenu.activeSelf)
     {
         int price = int.Parse(ShopManager.instance.select_price.GetComponent <Text>().text.ToString());
         Debug.Log(price);
         if (price <= PlayerManager.GetInstance().player.player_Point)
         {
             ShopManager.instance.gunBuy_check = 1;
             PlayerManager.GetInstance().player.BulletPower = int.Parse(ShopManager.instance.select_damage.GetComponent <Text>().text.ToString());
             PlayerManager.GetInstance().SubPlayerPoint(price);
             ShopManager.instance.UpdatePoint();
             ObjManager.Call().PlayerInfoUpdate();                 //총알의 각각의 파워를 정의
             PotionMenu.SetActive(true);
             GunMenu.SetActive(false);
             Select_menu.SetActive(false);
             GunButton.GetComponent <Button>().enabled = false;
             Buy_Canvas.SetActive(false);
         }
     }
     else
     {
         ShopManager.instance.potionBuy_check = 1;
         PotionMenu.SetActive(false);
         GunMenu.SetActive(true);
         Select_menu.SetActive(false);
         PotionButton.GetComponent <Button>().enabled = false;
     }
     ShopManager.instance.allBuy_check();
     SoundManager.I.PlaySFX("charge");
 }
示例#15
0
文件: Loader.cs 项目: wt616/JxqyHD
        /// <summary>
        /// Load game from "save/game" directory
        /// GuiManager must started first
        /// </summary>
        public static void LoadGame(bool isInitlizeGame)
        {
            if (isInitlizeGame)
            {
                //Clear
                ScriptManager.Clear();
                ScriptExecuter.Init();
                MagicManager.Clear();
                NpcManager.ClearAllNpc();
                ObjManager.ClearAllObjAndFileName();
                Globals.TheMap.Free();
                GuiManager.CloseTimeLimit();
                GuiManager.EndDialog();
                BackgroundMusic.Stop();
                Globals.IsInputDisabled = false;
            }

            LoadGameFile();
            LoadMagicGoodMemoList();
            LoadPlayer();
            //Apply xiulian magic to player
            Globals.ThePlayer.XiuLianMagic = MagicListManager.GetItemInfo(
                MagicListManager.XiuLianIndex);

            LoadPartner();
            LoadTraps();
            LoadTrapIgnoreList();

            Globals.TheCarmera.CenterPlayerInCamera();

            GameState.State = GameState.StateType.Playing;
            Globals.TheGame.IsGamePlayPaused = false;
            GuiManager.ShowAllPanels(false);
        }
示例#16
0
    static int GetObjManager(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 0);
        ObjManager o = LuaHelper.GetObjManager();

        LuaScriptMgr.Push(L, o);
        return(1);
    }
 void Awake()
 {
     panelRectTransform = transform.parent.GetComponent <RectTransform> ();
     objManager         = GameObject.Find("ObjManager").GetComponent <ObjManager>();
     mainCamera         = objManager.mainCamera;
     cameraBackground   = objManager.cameraBackground;
     UpdateCameraViewport();
 }
		public override async Task Process(Controller controller)
		{
			var protocolDriver = (NewDriver)ObjManager.GetObject(data.driverId);
			var driver = (Neo4j.Driver.Internal.Driver)protocolDriver.Driver;
			RoutingTable = driver.GetRoutingTable(data.database);

			await Task.CompletedTask;
		}
示例#19
0
    // Start is called before the first frame update
    void Start()
    {
        Init();
        ObjManager objmgr = Facade.Instance.GetManager <ObjManager>("ObjManager");
        GameObject obj    = objmgr.CreateAndLoadObj("firstpanel", "firstpanel");

        objmgr.SetPanel(obj);
    }
示例#20
0
        public override async Task Process()
        {
            IDriver driver = ((NewDriver)ObjManager.GetObject(data.driverId)).Driver;

            Session = driver.AsyncSession(SessionConfig);

            await Task.CompletedTask;
        }
示例#21
0
    void Start()
    {
        // 총알 생성 요청.
        ObjManager.Call().SetObject("Bullet");
        Vec = GameObject.Find("CameraVector").transform;

        Init();
    }
 void Start()
 {
     objManager      = GameObject.Find("ObjManager").GetComponent <ObjManager>();
     inputField      = gameObject.GetComponent <InputField>();
     inputField.text = 0.ToString();
     inputField.onValueChanged.AddListener(delegate { OnValueChanged(); });
     disableOnValueChanged = false;
     ifValueChanged        = false;
 }
示例#23
0
    public void RestartStage()
    {
        this.stage = 1;
        this.realTimeBulletNumber = 15;

        this.StageSetting();

        ObjManager.Call().CreateEnemyArea(10, 0, 1, 0);
    }
示例#24
0
    // Use this for initialization
    void Start()
    {
        Init();

        ObjManager objMgr      = Facade.Instance.GetManager <ObjManager>("ObjManager");
        GameObject panel_front = objMgr.CreateAndLoadObj("Panel_Begin", "Panel_Begin");

        objMgr.SetPanel(panel_front);
    }
    // Use this for initialization
    void Start()
    {
        objManager = GameObject.Find("ObjManager").GetComponent <ObjManager>();
        panelModel_PointsInformationController = objManager.panelModel_PointsInformationController;
        _boneNameToJointIndex = new Dictionary <string, int>();
        //_boneNameToJointIndex.Add("Pelvis", 0);
        //_boneNameToJointIndex.Add("L_Hip", 1);
        //_boneNameToJointIndex.Add("R_Hip", 2);
        //_boneNameToJointIndex.Add("Spine1", 3);
        //_boneNameToJointIndex.Add("L_Knee", 4);
        //_boneNameToJointIndex.Add("R_Knee", 5);
        //_boneNameToJointIndex.Add("Spine2", 6);
        //_boneNameToJointIndex.Add("L_Ankle", 7);
        //_boneNameToJointIndex.Add("R_Ankle", 8);
        //_boneNameToJointIndex.Add("Spine3", 9);
        //_boneNameToJointIndex.Add("L_Foot", 10);
        //_boneNameToJointIndex.Add("R_Foot", 11);
        //_boneNameToJointIndex.Add("Neck", 12);
        //_boneNameToJointIndex.Add("L_Collar", 13);
        //_boneNameToJointIndex.Add("R_Collar", 14);
        //_boneNameToJointIndex.Add("Head", 15);
        //_boneNameToJointIndex.Add("L_Shoulder", 16);
        //_boneNameToJointIndex.Add("R_Shoulder", 17);
        //_boneNameToJointIndex.Add("L_Elbow", 18);
        //_boneNameToJointIndex.Add("R_Elbow", 19);
        //_boneNameToJointIndex.Add("L_Wrist", 20);
        //_boneNameToJointIndex.Add("R_Wrist", 21);
        //_boneNameToJointIndex.Add("L_Hand", 22);
        //_boneNameToJointIndex.Add("R_Hand", 23);

        _boneNameToJointIndex.Add("Pelvis", 0);
        _boneNameToJointIndex.Add("R_Hip", 1);
        _boneNameToJointIndex.Add("L_Hip", 2);
        _boneNameToJointIndex.Add("Spine1", 3);
        _boneNameToJointIndex.Add("R_Knee", 4);
        _boneNameToJointIndex.Add("L_Knee", 5);
        _boneNameToJointIndex.Add("Spine2", 6);
        _boneNameToJointIndex.Add("R_Ankle", 7);
        _boneNameToJointIndex.Add("L_Ankle", 8);
        _boneNameToJointIndex.Add("Spine3", 9);
        _boneNameToJointIndex.Add("R_Foot", 10);
        _boneNameToJointIndex.Add("L_Foot", 11);
        _boneNameToJointIndex.Add("Neck", 12);
        _boneNameToJointIndex.Add("R_Collar", 13);
        _boneNameToJointIndex.Add("L_Collar", 14);
        _boneNameToJointIndex.Add("Head", 15);
        _boneNameToJointIndex.Add("R_Shoulder", 16);
        _boneNameToJointIndex.Add("L_Shoulder", 17);
        _boneNameToJointIndex.Add("R_Elbow", 18);
        _boneNameToJointIndex.Add("L_Elbow", 19);
        _boneNameToJointIndex.Add("R_Wrist", 20);
        _boneNameToJointIndex.Add("L_Wrist", 21);
        _boneNameToJointIndex.Add("R_Hand", 22);
        _boneNameToJointIndex.Add("L_Hand", 23);

        AddMainCameraSvi();
    }
示例#26
0
    public void Action(GameObject scanObj)
    {
        scanObject = scanObj;
        ObjManager objManager = scanObject.GetComponent <ObjManager>();

        Talk(objManager.id, objManager.isNpc);

        talkPanel.SetActive(isAction);
    }
        public override ResultType Execute()
        {
            if (student == null)
            {
                student = ObjManager.GetObj(RoleId) as Student;
            }
            ResultType resultType = student.IsHungry() ? ResultType.Success : ResultType.Fail;

            return(resultType);
        }
示例#28
0
 // 연속발사.
 IEnumerator NextFire()
 {
     ContinuouFire = true;
     while (ContinuouFire)
     {
         // 총알을 리스트에서 가져온다.
         BulletInfoSetting(ObjManager.Call().GetObject("Bullet"));
         yield return(new WaitForSeconds(AttackGap));
     }
 }
示例#29
0
        public override async Task Process(Controller controller)
        {
            var sessionContainer = ((NewSession)ObjManager.GetObject(data.sessionId));

            sessionContainer.SetupRetryAbleState(NewSession.SessionState.RetryAbleNegative, data.errorId);

            TriggerEvent();

            await Task.CompletedTask;
        }
示例#30
0
 public int exportPrecision;                  //导出的数据精确到小数点后几位
 void Awake()
 {
     objManager      = GameObject.Find("ObjManager").GetComponent <ObjManager>();
     sliderTriangles = objManager.sliderTriangles;
     exportPrecision = 3;
     dropdownExportPrecision.value     = exportPrecision;
     inputFieldActionLimit.text        = objManager.editorUndoRedoSystem.ActionLimit.ToString();
     inputFieldFieldOfView.text        = objManager.mainCamera.fieldOfView.ToString();
     dropdownTriangleMaxMultiple.value = 0;
 }
	void Start(){
		objMgr = Facade.Instance.AddManager<ObjManager> ("ObjManager");
		resMgr = Facade.Instance.AddManager<ResourceManager> ("ResourceManager");
	}