Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     boardTransform    = GetComponent <Transform>();
     initBoardRotation = boardTransform.rotation;
     pScript           = boardTransform.parent.Find("Player").GetComponent <playerAction>();
     bgScript          = boardTransform.parent.Find("bg").GetComponent <bgAction>();
     target            = GetComponent <Renderer>().bounds.center;
 }
 // Start is called before the first frame update
 void Awake()
 {
     boardTransform    = GetComponent <Transform>();
     initBoardRotation = boardTransform.rotation;
     escapeGateScript  = boardTransform.Find("escapeGate").GetComponent <escapeGateAction>();
     speedGatesScript  = boardTransform.Find("speedGates").GetComponent <speedGateController>();
     pScript           = boardTransform.parent.Find("Player").GetComponent <playerAction>();
     keysScripts       = boardTransform.Find("Keys").GetComponent <keyController>();
     bgScript          = boardTransform.parent.Find("bg").GetComponent <bgAction>();
     cameraScript      = Camera.main.GetComponent <levelSwitch>();
     target            = GetComponent <Renderer>().bounds.center;
 }