12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using ShadowStudio.Model;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using XRTool.Util;
- using static ArtTaskAction;
- using static ArtTaskInfo;
- public class ArtTaskChild : MonoBehaviour
- {
- public TaskType ttype;
- public ArtContainerHandler artContainerHandler;
- private void OnDestroy()
- {
- ArtTaskInfo.removeChild(this);
- }
- private void Start()
- {
- ArtTaskInfo.addChild(this);
- }
- // Update is called once per frame
- void Update()
- {
- checkPos();
- }
- public bool isFinish;
- void checkPos()
- {
- if(!isFinish&& !CommonMethod.isLookRoom())
- {
- List<ArtTaskAction> ata = ArtTaskInfo.getTaskList();
- for (int i = 0; i < ata.Count; i++)
- {
- GameObject TaskGame = ata[i].actionGame;
- ArtTaskAction taskAction = ata[i];
- if(ata[i].ttype==ttype)
- {
- if (taskAction.aaType == ArtActionType.ACTION)
- {
- float dic = Vector3.Distance(this.transform.position, TaskGame.transform.position);
- if (dic < 0.1f)
- {
- taskAction.showFinishAction(true);
- isFinish = true;
- if (artContainerHandler != null)
- {
- Debug.Log("删除Container");
- artContainerHandler.DelArtSync();
- }
- }
- }
- }
- else
- {
- if (taskAction.aaType == ArtActionType.ACTION)
- {
- float dic = Vector3.Distance(this.transform.position, TaskGame.transform.position);
- if (dic < 0.1f)
- {
- taskAction.ShowTipError();
- isFinish = true;
- if (artContainerHandler != null)
- {
- Debug.Log("删除Container");
- artContainerHandler.DelArtSync();
- }
- }
- }
- }
- }
- }
- }
-
-
- }
|